Cornering pseudoscalar-mediated dark matter with the LHC and cosmology