Include the <algorithm> header for std::min.

This fixes the build for Visual Studio 2013.