Fix deadlock on stop failure