Fix query-for-host-and-service-test crash

when evaluating and expressions like (and (= metric 2)) things were fine, but
not when evaluating something like (and metric), no bueno!