Currently the database dir is set at startup and stays unmodified even
after the sighup handler has reloaded a configuration which specifies
a different database path.
This patch makes it possible to switch to a different database after
SIGHUP was received. To make this work, we only have invalidate the
database_dir pointer after the database has been closed.