Make addprotocol() compatible with unicode literals

Changes:
- use basestring as basic mandatory type instead of str