Fix hmac new str encoding for Python 3