Removed some races

Now that the go runtime has a race detector, it was much easier to get
rid of some race bugs. Alltaough this application was built some time
before the channel cheduler matured it still runs.