bson: explicitely check escape result before adding to JSON.