[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 replace a direct call to iterator_to_array by
a call to Cursor::toArray() (DRY principal and better respect of encapsulation).