Fix hanging pointer on shutdown of GUI

Deselect widgets being edited for delete commands