(JAVA-722) Errors when DBRef's $id is Object instead of simple value

Please see the JIRA ticket (https://jira.mongodb.org/browse/JAVA-722)

Added fix and tests.

Thanks in advance and wait for your response,
Alex