Phase matching of high-order harmonics in a semi-infinite gas cell