exit on unexpected error.

The agent is stopping when having an unexpected error.

* exit on unexpected error.
* retrying connect on error ENETUNREACH or EHOSTUNREACH too.