Log but otherwise ignore errors in main loop

Don't let the main loop break out on an unhandled exception. Log it, and keep
trying.

Change-Id: Ie382a00fb4b657ffe8875ab4089b31dde241dc28