Remote refcount fix

Fix the refcounts in remotes (issue #403) by setting the callbacks just before fetch, and resetting to defaults after.  I *think* I got it right, but I'm not super-familiar with cffi so let me know if I did something stupid.

I also added a few tests to look for refcount leaks after accessing various properties.