Probing the origin of prion protein misfolding via reconstruction of ancestral proteins