Two-state system driven by imperfect π pulses: An estimate of the error accumulation in bang-bang control methods