Hide preferences dialog on close.

Fixes #13.