Fix NPE in has_child filter and query.

Fixed NPE if matched parent docs is higher than short_circuit_cutoff.
Closes #4135