location.js: provide an error handler

Provide an error handler for the geolocation API, otherwise on at least
some devices it won't work at all.