Add debug toggle via environment variable

Turn on debugging with

    export FATCHAN_DEBUG=X
Debugging print improvements

Use log.Printf instead of fmt.Printf due to races (multiple goroutine output appearing on the same line).
Always print cid as hex in debug messages.
Report more write errors
Typo
Add error checking on channel reads