Implement Hash and PartialOrd for RingBuf

cc #15294
I think in general collections need to hash their length first because otherwise this would have the same hash:

* `(vec![1], vec![2, 3])`
* `(vec![1, 2], vec![2])`