fix data races and turn on race detector by default.

In #309, we ended up with using ``sync.Cond``, which introduced the data race again.

In this PR, I use channel instead of ``sync.Cond`` similar to the first commit in #309. The difference is that instead of using close() to broadcast, I used the send operation.
Ok, just edit the .travis.yml file to remove go1.2, we can try to re-add it
later, perhaps with race detection off.

--brendan


On Wed, Jul 2, 2014 at 11:24 PM, Brendan Burns <bburns@google.com> wrote:

> Right the trouble with it being a pointer, is its always a pointer to the
> same chunk of data, imagine the for loop looks like:
>
> for {
>   obj := config[i]
>   ...
>   func(&obj)
> }
>
> The race continues, because the data stored in obj, keeps getting
> overwritten.
>
>
>
> On Wed, Jul 2, 2014 at 11:18 PM, monnand <notifications@github.com> wrote:
>
>> In pkg/kubelet/kubelet.go:
>>
>> >  			if err != nil {
>> >  				glog.Errorf("Error syncing manifest: %v skipping.", err)
>> >  			}
>> > -		}()
>> > +		}(&manifest)
>>
>> Yes, it will always be a pointer. Is it what we want? May be I
>> misunderstand the code. I will change it to use same approach in #350
>> <https://github.com/GoogleCloudPlatform/kubernetes/pull/350> (and
>> hopefully it could make git to auto merge this PR.)
>>
>> —
>> Reply to this email directly or view it on GitHub
>> <https://github.com/GoogleCloudPlatform/kubernetes/pull/348/files#r14498422>
>> .
>>
>
>