gensec: Make sure to check the optional auth_context hooks before using them