[DON'T MERGE - JUST REVIEW] Fixes atomicity issue of TransactionalMap.{get(), containsKey() etc}

Fixes #3191