An ab initio study of intramolecular hydrogen bonding in malonic acid and its monoanion