Fix "Halting Problem" example

As discussed in #71, the original example contains a race condition that could cause the goroutine to block forever.