Resolves exception during edit when restoring focus (closes #17, closes #18)

While editing a note, changing to another application and then changing back
to NoteCipher again causes a fatal exception. This causes the application to
die and then forces the user to enter the password again.