HHH-3868 Fix null pointer exception on merge of entity with transient co...

https://hibernate.atlassian.net/browse/HHH-3868

already applied to 4.3 and master, it needs to be applied to 4.2