Check for ref names being instance of basestring rather than str

Checking for instance of str causes problems when using Dulwich
in a Django application where ref names are given as unicode
strings.