Allow value object identifiers

After updating to 2.3 I got some strange error messages about entities not being found etc.

I seem that some where along the way the support of custom doctrine types as identifiers got lost this patch fixes this.
At what point is it expensive? Looking at the `isInIdentityMap` code the only possible expensive call is `$this->em->getClassMetadata(get_class($entity));`. 
Also to my knowledge `spl_object_hash` and `isset` calls are not expensive. 
So could you please clarify?