wscript: fix repeatedly appending all the js files

Changes the open mode on src/js/pebble-js-app.js to write instead of
append, to prevent multiple copies of the source JS files from
populating the destination file.
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.
Avoid integer overflow in distance calculation

Fixes #3, without using a poor distance calculation.
Merge pull request #2 from dwfreed/fix-location

Provide an error handler to geolocation lookup
train_times_list.c: fix a selection bug

The currently selected row can be greated than the stop time count, as
is the case when there are no future stops in the current day, so check
that the selected row is less than that, otherwise just ignore the
click.
Merge pull request #1 from dwfreed/fix-wscript

wscript: fix repeatedly appending all the js files
Merge pull request #4 from dwfreed/fix-selection

Avoid presenting a nonsense trip when no trips exist.