The best way to prevent that (well, actually the only way) is just to move your buff bar to somewhere you won't click them off accidentally. I have mine at the bottom of the screen, to the right of the hotbar. In that location it's quick to glance between the buff/debuff list and the hotbar too, which is always an advantage.