Add GREATEST_FAILURE_ABORT() query.

This checks whether it is in first-fail mode, and if there have been any failures.