Quantum oscillations and magnetic field induced Fermi surface reconstruction in the charge density wave state of A0.9Mo6O17 (A=Na,K)