Improved PathChooserDialogue handling of invalid selections

This addresses Ivan's #628 by disabling the confirm button when the current selection isn't valid - I thought it was worth doing while all the PathChooserDialogue stuff was fresh in my mind. Only the last 4 commits are new to this pull request - the rest are from the bookmarks pull request (they both touch the same code, so can't be pulled separately).