Add a copy-on-write container.
Added Freeze trait to CowArc
auto merge of #11230 : csherratt/rust/cow, r=alexcrichton

This allows patch adds a new arc type that allows for creation of copy-on-write data structures. The idea is that it is safe to mutate any data structure as long as it has only one reference to it. If there are multiple, it requires cloning of the data structure before mutation is possible.
Improved pattern-match code and explanation.

This cleans up a warning about an unused variable and explains the code
further.