libmdb: Don't open datafile twice when not needed.
libmdb: Don't open datafile twice when not needed.

If the database is opened with MDB_RDONLY or MDB_NOSYNC,
instead use the same file descriptor for me_mfd and me_fd.

Also factor out Windows/Unix error handling after open.

bobek-balinek/BlueJet