Add test case and bug fix for double serialization of delete_by_query qu...

Fixes a serialization bug in the delete_by_query method for the upgrade to elasticsearch 1.x.x. The fix avoids calling `json.dumps` twice on the query and causing a malformed query exception from elasticsearch.