MODE-2005 Additional fixes for jcr:mergeFailed.

This is my local branch of the additional fixes for MODE-2005, as an alternative to https://github.com/ModeShape/modeshape/pull/908.