Class CommitTracker

Helper class for tracking autoCommit state.
Note: This is purely an implementation detail of autoCommit and will
definitely change in the future, so the interface should not be relied-upon
Note: all access must be synchronized.
Public for tests.