Remove unnecessary 'typename' keyword.

Visual C++ rejects this with:
  error C2899: typename cannot be used outside a template declaration
Use different maximum integer for Visual C++.

MSVC doesn't treat std::numeric_limits<T>:max() as a compile-time constant.
Move static variables into blocks.

Visual C++ rejects the previous code:
  error C2360: initialization of 'zlib_corrupt_msg' is skipped by 'case' label