Need a central piece to manage the catalogue data per database to prevent loading
this multiple times. MasterController is now also used to enable reopening the
connection manager from a query window after the connection manager has been closed.
This is something libpq also does when opening and closing connections.
This mechanism uses a use count and based on that count dll's are loaded
and unloaded. By adding those calls to main we make sure the use count
stays above zero for the whole duration of the program.