Add robustness in TBSONObjectProtocol

-- Convert double to long when possible.
-- Other similar conversion.