tools: try to fix std::min ambiguity for MSVC

Change-Id: Id81ad8702d513c5bb3f4f8de2f9d7c75c7852d4d