Stability of Bernstein–Greene–Kruskal equilibria