check_response: a variant of check_status that uses arbitrary predicates

This ticks the second box of #824.