Release GIL during C++ object destruction

This tidies up the RefCounted binding mechanism a little, and then introduces a change which causes the GIL to be released during destruction of C++ objects. This is necessary to fix the following Gaffer issue.

https://github.com/ImageEngine/gaffer/issues/855

Note that any bindings using the RefCountedClass with a non-default second template argument will be affected - they need to be modified to pass their a Wrapper class instead of a WrapperPtr class. I'll put in a pull request to do this for Gaffer, but it will also need doing for any other projects employing wrappers (I believe there are still 2 in IERendering, and 1 in IEFur, but I didn't spot any others in a quick search on GitHub).