As shown in Fig. 1, draw the circumcircles of △ABC, △ABP and △ACP, respectively. Let the extension of AP meet ⊙O at D, join BD, and draw the line tangent to ⊙O at A, intersecting ⊙O1 and ⊙O2 at E and F respectively.
It is clear that △AMC∼△ABD, hence
BDAB=MCAM.
Since △EAB∼△PDB, we have BDAB=PDAE.
Consequently, MCAM=PDAE, i.e.
AE=MCAM×PD,
and, similarly,
AF=MBAM×PD.

Fig. 1
It follows that
AE=AF.①
Draw the perpendicular lines O1E′⊥AE with foot E′, and O2F′⊥AF with foot F′. Since E′, F′ are the midpoints of AE, AF respectively, it follows from ① that A is the midpoint of E′F′.
In the right-angled trapezoid O1E′F′O2, AO is the extension of the median, and hence it bisects the segment O1O2.
Solution 2:
As shown in Fig. 2, draw segments AO1, OO1, AO2, OO2. Denote by Q the intersection of AO and O1O2. Then

Fig. 2
QO2O1Q=S△OO2S△OO1=AC×OO2AB×OO1,
where ACAB=sin∠ABCsin∠ACB.
Since ∠OO1Q=∠BAP=∠CAM, and ∠OO2Q=∠CAP=∠BAM, it follows that
OO2OO1=OQOO1×OO2OQ=sin∠OO1Qsin∠OQO1×sin∠OQO2sin∠OO2Q=sin∠OO1Qsin∠OO2Q=sin∠CAMsin∠BAM,
and thus
QO2O1Q=sin∠CAMsin∠ACM×sin∠ABMsin∠BAM=CMAM×AMBM=CMBM.
Note that M is the midpoint of BC, and therefore O1Q=QO2, i.e. line AO bisects segment O1O2.