Fix for the cache poisoning issue with relationship chain position

Ensures that WriteTransaction invalidates the cache entries of deleted entities on Command execution
 and not on prepare.
Introduces method TransactionState.patchDeletedRelationshipNodes() which has its concrete implementation
 in NodeManager. That fixes the relChainPosition of affected nodes when they are in cache.
Uses that method when there are relationship deletes, namely in Command application and
 WriteTransaction.prepare()
Introduces tests for the above changes
Updates changelogs

This is a backport of commits 2ad8f36c3950371ae963a40311dd41f52c8b90f5 and
  3b18bfadcf1424c23698cf5d5a0e8691ba1c5e2c from master branch