Theoretical studies of the 2- and 4-hydroxybenzoic acid with competing hydrogen bonds in the gas phase and aqueous solution