py3: use pycompat.bytestr() instead of str() in extensions.py

Authored by pulkit.