janitor plugin fix crash and better idle detect

fixed access violation crash and implemented some additional tests for
detecting idle units.  It will now exclude idle jobs such as military
training, individual combat drills, on break, and units with new migrant
status.