Fix Curso::sort() casting "$meta" arrays/objects to integers

Fixed the casting as mentioned in https://github.com/doctrine/mongodb/issues/152#issuecomment-57297661

Also included extra tests for this new and the existing casting behaviour.