Fix to prevent hung gestures when browser dont trigger touchend

Fixes the problem with gestures which dont get ended when the browser
dont trigger touchend but triggers mouseup.