Fix pear idle handling in monitor callback

Since the monitor gets called each time it polls the server, we want to make sure it is not an idle connection before we check to see if we have run more than max_runs_per_worker otherwise that threshold will be reached much faster than expected (and possibly without ever running a job).