bacsd: auto reconnect implementation.

Auto reconnect on initial database connection failure.