Fix first message after DB outage going to status buffer
Quassel doesn't know that the DB connection has terminated until
it actually tries to execute a query.  This was causing the first
query after a lost connection to fail, which in turn was causing
the first IRC message sent/received after such an event to go
to the status buffer, since the query to decide which buffer in
which to put it was failing.  Additionally, the QSqlDatabase
isOpen() function doesn't actually try to contact the DB server,
so it doesn't accurately report whether the connection is up or
down.  This patch introduces a new isConnected() function that can
be overridden by the storage backends to check if the connection
is up.  If the connection is not up, reconnection will be
attempted.  It also adds such an override for the PostgreSQL
backend.