Better exception handling for 'appscale-gather-logs'

Using list of nodes stored in locations.json if we can't get an up-to-date list from the AppController (e.g., if the appcontroller has failed).