Clipboard improvements

Various improvements in how clipboard access is handled. On Linux (GTK backend to wx) this solves a crash at exit and a problem where the paste option in the menu is blinking when editing passage text.