Reconnection support to KeepAliveAgent

ConnectedDB.KeepAliveAgent is enhanced to reset the database connection
field of ConnectedDB if it notices that the database connection was
lost.