[2.2] Fix race condition between constraint creation and slave write.

This removes two race conditions present in 2.2 where a constraint creation
could be violated by a commit coming from a slave. By grabbing a schema read
lock on every slave commit, we ensure exclusive access to committing schema
transactions.