[BLD] Fix remaining compile-time warnings
With the exception of Numpy-Deprecated-API-1.7 warnings that _any_ cython code produces, this fixes all remaining compiler warnings (... on py27, there's still a whole mess of them in py37).

Based on a little bit of profiling it looked like `npy_isnan(x)` gives a 40% perf improvement over `x != x`.  But profiling is hard, so who knows.  In the comment where npy_nan is imported there is a link to a discussion about it.