Add safeguard for initialization

This makes sure we only try to MMDB_close when we successfully opened
the handle.