Do not fail on error in judgehost poll loop, but just keep retrying.

This restores the approximate behaviour from the pre-API days, where
a failure to connect to MySQL would not lead to a judgedaemon crash
but would be retried until it works again.

In this implementation we only ignore errors in the poll loop when
the judgehost is idle. This is the most common state for a judgehost
and will not make all judgehosts crash if you need to restart Apache
or MySQL.

If a judgehost encounters an error when using the API as part of the
judging process, it will still crash. This seems the safest option.
Restarting the judgehost after such a crash will probably resolve
this state.