Conditionally deregister touchend listener

This PR supersedes #1398. It fixes a bug in the vector-api branch where vector layers are not redrawn after pinch-zooming on touch devices.

Previously, the touchend and touchmove listeners were unconditionally deregistered on touchend, which resulted in missed touchend and touchmove events. We now deregister the touchend and touchmove listeners only when there is no finger on the screen.

Note that the same sort of fix should be made for pointer events/devices. I haven't changed the pointer-related code because I don't have a "multi-pointer" device at hand.