Replace isinf with std::isinf.

Using isinf (not std::isinf) causes compilation error on OS X 10.8.