Use basestring instead of str for type check.

This avoids odd behaviour if a unicode string is passed into
`envoy.run` where the command isn't split for subprocess.