Set ready exiting from the scope early

so that the main thread won't deadlock on self.ready if bad things happen.