Explaining $h\to\mu^\pm\tau^\mp$, $B\to K^* \mu^+\mu^-$ and $B\to K \mu^+\mu^-/B\to K e^+e^-$ in a two-Higgs-doublet model with gauged $L_\mu-L_\tau$