Run executes the agent using the given config and backend.
When the function finishes it returns an exit code of
0 if the agent terminated gracefully, either by receiving a TERM signal or
because it passed more time than configured without reading a message.