A single fast radio burst localized to a massive galaxy at cosmological distance