add stop method for tests, correctly check for thread existence in cases where it may no longer be present
add stop method for tests, correctly check for thread existence in cases where it may no longer be present

expectedbehavior/instrumental_agent