Optical flashes and very early afterglows in wind environments