Electrostatic binding in the first-row AH and A2 diatomic molecules