Optimal Control of Mechanical Ventilators with Learned Respiratory Dynamics