Molecular confinement influences protein structure and enhances thermal protein stability