editted remove_member() to cancel and join target thread in case the target thread is the same as the calling thread
revised remove_member to join the cancelled thread in case the target thread is the calling thread