The optical polarization of the blazar PKS 2155–304 during an optical flare in 2010