Use threading.Event to less chance of race cond

that seems to be causing intermittent Travis CI failures.
Merge pull request #5 from msabramo/use_event_to_less_chance_of_race_cond

Use threading.Event to less chance of race cond