Made DB commit() method properly bail out if no trx is active

* Also flipped conditional to avoid being in the negative

Change-Id: I30bce9a015bea5909322bba93493500b5b418d18
Merge "Made DB commit() method properly bail out if no trx is active"