Use basestring instead of str for type check.

Change-Id: I1dbf453cc08bd8aaeb4fee2491a1e8aa74f8bee3 introduced some
checks to is_older_than and is_newer_than functions against str instead
of basestring.

I'm aware that basestring doesn't exist in Python3 but since it isn't
a target right now and there's no "standard" way to support it right now
in openstack.

Change-Id: I8d67d384637dfdde3f5621052d8511e7b6ecab7b