MODE-2251: Validate references before delete node

This PR does check that node does not references other node before allow to delete node.
this method is already part of the API: `node.getReferences().hasNext()`