MODE-2047 Fixed locking of transient nodes

According to the Javadoc from the spec methods any kind of locking on a node which contains modifications should throw an `InvalidItemStateException`.