Python 3: replace 'basestring' by 'six.string_types'

'basestring' will only work in Python 2. Using 'six.string_types' instead makes
the code compatible with both Python 2 and 3.

Change-Id: I572506ce6d0cc7570dc264711d19619746949d49
Merge "Python 3: replace 'basestring' by 'six.string_types'"