Rework and extend the unicode branch/ref name tests.

Depends on https://github.com/libgit2/libgit2/pull/2358. Fixes #361.