DDC-3120 - PHP 5.6 internal classes/Serializable serialization fix

See DDC-3120 ( http://www.doctrine-project.org/jira/browse/DDC-3120 )

This PR provides a backport for the 2.4 branch