Show the retry attempt number on the logs for JMX Monitor/Collector

In order to understand better how the JMX Monitor/Collector is behaving,
it is useful to know how many attempts are executed on the monitor and
the collector.

In case of the monitor, the JMX connection is done inside the retry
loop, but for the JMX collector, the connection is created outside the
retry loop.