Remove unnecessary call to smart_str().

self.stdout.write calls force_str(), and requires a non-bytes string
before that to e.g. call endswith().