Measurement of the omega -> pi^0 e^+e^- and eta -> e^+e^-g Dalitz decays with the A2 setup at MAMI