avoid panicing and return errors when MDB fails

MDB transaction starting can fail due to resource overloading. instead of panicing just return errors.
I only fixed these two functions since I am running into issues with them, but could fix other ones too, that start transactions.