check if thread is null before trying to interrupt