fix a bug with pointInPolygon

function `pnpoly` forgot to add the first point again.
See http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html