test: Check exit status in run_and_log_expect_exception()