SERVER-14107 Querying for a document containing a value of either type Javascript or JavascriptWithScope crashes the shell

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Merge remote-tracking branch 'upstream/v2.6' into v2.6