Fix crash at exit when there is a log after the Logger has been destroyed

Use a proper static Logger instead of allocating one,  and cleanup
the QTMessageLogger when it is destroyed
Make FolderMan a member of the application

The goal here is that it is going to be destroyed with the application
It need to be destoyed so the folder are destroyed, which is required
for properly finishing the sync while exiting.

It must not be destroyed after the application because the QSQLite plugin
may be already destroyed in that case.

Since the constructor of FolderMan is called earlier, we can't call the
config file too early

 fixes 1793