Deactivate selection location boxes when no selection is active

Per RR's good suggestion
Automatically select the relevant tool when Undo/Redo is used

Fixes #72

The general idea here is that Undo/Redo is used when the user wants to
return the current image to some previous state.  In many cases, this is
because they want to change or modify some past action they took on the
image.

If that action involved selection tools, PD now strives to be intuitive
about restoring the tool relevant to the undone action.  For example, if
the user uses "undo" to return to a state where they resized a
rectangular selection, the rectangular selection tool will automatically
be selected for them.  This should allow for fast, intuitive fixes to
past actions.

It also solves a problem with the software being totally confused by
switching between selection tools.