Optimization of high-order harmonic generation by adaptive control of a sub-10-fs pulse wave front