The $D^*D \pi$ and $B^*B\pi$ couplings from light-cone sum rules