Fixed bug that caused RWLock not to free up entries in txLockElementMap.

The mark flag is used to guard against creating multiple RWLocks for the same resource and has nothing to do with TxLockElement entries.

TxLockElement creation and removal is still safe since it is synchronized on the RWLock.
Fixed compile error.
Merge pull request #2460 from johan-neo/2.0-maint

Fixed bug that caused RWLock not to free up entries in txLockElementMap.