Do `quit()` if the system requested the app to close.

This fixes the issue where a system logout was blocked by bitmask since
we were interpreting the closeEvent as if the user clicked on the 'X'
button.
Closes #5870.
Fix misused import.
Prevent quit() being called more than once.

Conflicts:
	src/leap/bitmask/gui/mainwindow.py