Ensure the document is utf-8 encoded before inserting, updating or removing it

See https://github.com/mongodb/mongo-php-driver/blob/4017850ea86ad7dd28139f1af4fb45fb837156c6/bson.c#L223-L227