You can call the simplify task on the geometry before sending it to the query task. The simplify call will return a geometry that is not self crossing and will return the correct results. Here is an example of the using Simplify on a geometry before using it to query results.