Replace basestring with six.string_types

Fix Python 3 compatibility issue with `ext/invoke.py`.