First‐principles prediction of acidities in the gas and solution phase