Fix xi2 mode

Various crashes and other issues were noticed when using mtview to validate the proper handling of touch inputs on ISDv4 touchscreens. These have been addressed, and "--mode=xi2" now works much better for me ;)