Safer repository pointer extraction

Casting a pointer to a non-pointer type is something which you should
never do. Instead, do something a bit more convoluted, but which is
guaranteed to give us the right pointer, as well as making sure that the
memory we exchange between python/cffi and the C extension is of the
right pointer size.

While we're touching this code, fix which object we pass to the Remote
constructor to keep alive. We need to pass the Repository object to
stop it from becoming unreferenced (and thus freeing memory the remote
needs) instead of the git_repository pointer.
ffi: style changes

Make to_str() accept None as well as ffi.NULL to return as a negative
value, and grab the version in a more compatible way.
Optionally skip online tests

It sometimes happens that one finds oneself on a train. Exporting the
PYGIT2_OFFLINE environment variables disables the tests that need a
working network connection for such cases.
Remote: protect against invalid input on raname

The C API expects a non-NULL new name and raises an assertion if we
don't protect against such input, so let's guard against falsy values,
which also takes care of the empty string, which is also not valid
input.