Implement Hash and PartialOrd for RingBuf

cc #15294
Interesting, I didn't' think of that. That means that some of the other Hash implementations I've done are wrong (at least TreeMap is).

I've fixed it for RingBuf here.