MAINT: Move FutureWarning in nansum.

Currently a FutureWarning about the sum of empty slices changing to zero
is always raised. Instead make it depend on the actual occurrence of an
empty slice.
TST: Test that FutureWarning is not raised by nansum if not all-nan.
Merge pull request #3745 from charris/move-nansum-warning-in-1.8

Move nansum warning in 1.8