Models with two Higgs doublets and a light pseudoscalar: A portal to dark matter and the possible (g−2) excess