hooks: use proper exit status for failures in hook execution