rust-cpython: make inner functions and structs of ref_sharing private
Most of these methods were public because they had to be accessible from
macro-generated functions. Some "unsafe" can be removed since we can
guarantee the data consistency across non-public operations.
To run the tests, do:
cd tests/
python run-tests.py
See https://mercurial-scm.org/wiki/WritingTests for
more information on writing tests.