BUG: Fix invalid value raised as error when testing on Windows.

The invalid value RuntimeWarning is raised as an error in numpy
testing, and in this case the Window build was raising the warning
for comparisons of NaNs.

Fixes the first error in #4698.
Merge pull request #4700 from charris/ignore-invalid-value-in-test

BUG: Fix invalid value raised as error when testing on Windows.