Added more robust array_diff E_NOTICE fix

Code ported from @shouze's (github.com/shouze) commit to the
rezzza/doctrine1 fork.

See https://github.com/rezzza/doctrine1/commit/0b838e for more
information.