An internal thioester in a pathogen surface protein mediates covalent host binding