Fix the bug which was causing the waiting_for_threads_to_disconnect state to take > 5s - Issue #11