Likelihood analysis of the flavour anomalies and g – 2 in the general two Higgs doublet model