Fixes touch detection in the headless PhantomJS browser.

PhantomJS is used by Travis-CI (see #1025) for unit testing. The touch detection issue throws off a number of SC unit tests. Fixes #1018.