Cause and repair of optical damage in nonlinear optical crystals of BiB3O6