fixed bugs in ring buffer implementation

1. caused by not touching r.readCache when following the branch
that puts a buffer into the pool. this caused unbounded memory
consumption.

2. caused by not properly keeping track of the slice used by the
reading side. it caused it to shorten the slice to cap==0 which
forced the writer to allocate new space and leak memory. fixed
by keeping track of the original slice and putting that into the
pool instead.