mdb-backend: refix ITS#7915 to avoid memory leaks.