fix possible library errors on mcomix termination

When terminating mcomix with the library window still open, you
sometimes get a dead-lock and those errors:

16:06:22 [Thread-4-thumbview] ERROR: ! Worker thread processing [...] failed: Cannot operate on a closed database.

The fix is simple: make sure we close the library window before
terminating the library backend.

git-svn-id: svn://svn.code.sf.net/p/mcomix/code@1064 ef8490bc-f317-4725-81ed-e95a9aca1bcf