Store the PAM handle in the Authenticator class and close the session properly