Fixed the compilation errors in mod.cu

The generated mod.cu contains a number of std::min and std::max. Including <algorithm> will remove the not-found errors from these two functions.
Moved #include <algorithm> outside

Moved `#include <algorithm>` outside the `#if PY_MAJOR_VERSION >= 3` block.
Merge pull request #2053 from ziyuang/master

Fixed the compilation errors in mod.cu