MODE-1828 - ConstraintViolationException when updating the definition of the same node in a session

Fix the issue by making sure that nodeTypes with the same name is actually updated properly in the cache.