Fix use of basestring in python3 using six