Patient-ventilator interfaces for invasive and non-invasive ventilation