BUGFIX: properly reconnect to the current db after forking