Polygon-based extraction does not treat NaNs properly

Cubes with NaNs in them end up with all-NaN slices if polygons are used.  This PR fixes that.