The corrections I made in #2 to your code from #1 make the crash-on-exit disappear and reordering work correctly for me.
Dragging an item off the list widget removes it completely either way.