[DocumentRepository] Use Cursor::toArray() instead of iterator_to_array()

As per https://github.com/doctrine/mongodb-odm/pull/752#issuecomment-32599172
by @tgabi333 and following. This replaces a direct call to iterator_to_array by
a call to Cursor::toArray() (DRY principal and better respect of encapsulation).
Merge pull request #769 from lemoinem/fix/DRY-converting-cursor-to-array

[DocumentRepository] Use Cursor::toArray() instead of iterator_to_array()