Fix unnecessary creation of MDB when in the process of closing an alread...

...y closed MDB.