Alphabet Inc.’s Google struck a deal to pay about $2.4 billion for top talent and licensing rights from artificial intelligence coding startup Windsurf following the collapse of Windsurf’s agreement to be bought by Google rival OpenAI, according to people familiar with the matter.