Transfer matrix approach to the persistent current in quantum rings: Application to hybrid normal-superconducting rings