Attempt to shutdown thread outside lock