Add test exposing UnitOfWork merge bug

I hope that I'm doing something wrong and that this is not a bug ...
The issue when you remove this is that you now allow using unmanaged entities in identifiers even in contexts where it should not be allowed. Fixing the retrieval of the id when merging should not be done by opening all other cases for bugs.