update stop of JAMon monitors in a finally block

Sometimes the JAMon monitors are not stopped when an exception occurs. For that case, I have moved them into a finally block.