While looking through various books, I found that the Reverend Dr. Stephen Hales, a botanist (!), already invented in the 1720's a special thermometer for measuring the water temperature.
Such an instrument was used later commonly - at least so at the time of Cook's second voyage. (See: J.R. Forster, Observations Made During a Voyage Round the World, on Physical Geography, Natural History, and Ethic Philosophy, London, 1778)
International recommendations for SST (Sea Surface Temperature)measurement were first established at the Brussels Maritime Conference of 1853. (Source: J. B. R. Matthews, Comparing historical and modern methods of sea surface temperature measurement – Part 1: Review of methods, field comparisons and dataset adjustments, 2013 [in Ocean Science, 9, 683–694, 2013])