C implementation of Go-style channels