SERVER-14015: Fix S2 Compilation on GCC 4.9/Solaris by choosing sqrt(double)

(cherry picked from commit 885e11b64dae39b4a90304e754caa26254442180)
Merge remote-tracking branch 'upstream/v2.6' into v2.6