Tree level vacuum stability in two-Higgs-doublet models