Just before he was scheduled to be introduced in San Francisco, the star shortstop’s free agency took a turn — that ended with him joining the Mets.