replace all std::min/std::max with just min/max

This errors out in MSVC since the inclusion of winsock2.h, CL uses the
macro not the template version.