DDC-2965 - Changing ID generation after `flush` makes persisters unusable

As posted on http://www.doctrine-project.org/jira/browse/DDC-2965 by @psliwa (imported his tests)