Fix BsonQueryFactory so that it can update polymorphic fields

In `BsonQueryFactory.marshallDocument()`, wrapping the parameter in an untyped object causes problems when updating polymorphic fields: the additional JSON attribute that is added to identify the actual subclass of the instance is lost.

This is caused by the fact that during serialization, Jackson only considers annotations on a class only for the root object (the one that is being serialized) or class members.

As the wrapping is meant to handle the (rare?) case where objects are serialized as primitive values, we do the wrapping only if the initial serialization returned an object with no properties.