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.
Ah, I was doing it in a little bit of a weird order.. I wanted to create the "default" callbacks first so that any error could raise before the custom callbacks had been set.. but fair point about the version number being set differently on the two lines.. if it changes in one place it will need to change in both,