The RoboPol optical polarization survey of gamma-ray-loud blazars