Pedrosa on front row despite mistakes in Q2