builtin/apply: make check_apply_state() return -1 instead of die()ing