Fix infinite loop in UoW with bidirectional inheritance dependencies

This supersedes PR #693. Making `UnitOfWork::getCommitOrder()` consistent with ORM (with minor changes) and removing our recursion of a private method also avoids the infinite loop triggered by #693's test case.

For context, this code was last changed in:

 * https://github.com/doctrine/mongodb-odm/commit/cf3b4a0b4ef6a0a648b40e93daaf5a9a66c4f438
 * https://github.com/doctrine/mongodb-odm/commit/f170a9a270410c17b64ad4e7b1692093520568ab

@oparadis: Please let me know if this works for you.