Current fluctuations at a phase transition