Dual Function of Protein Confinement in Chaperonin-Assisted Protein Folding