Detecting and correcting patient-ventilator asynchronies