Ensure we do not fail on proxy classes

Alternative to #436

I am not 100% sure why @AxaliaN got an error, but suppose he did get_class in userland code. the phpcr-odm only does get_class for exceptions and when interacting with getClassMetadata which in turn uses doctrine utils.

but i still think it does no harm and could help avoid unexpected errors with proxies.