hooks: Add function to check if a hook exists