Python 3 warning fixes and code cleanups

* Drop unused imports
* Avoid BytesWarning in debugging messages in Python 3
* Implement Section.__hash__() to avoid Python 2’s DeprecationWarning
* Use integer division in Python 3.
    This means
    DwarfConfig.default_address_size is now an integer in Python 3,
    as in Python 2.
* BaseException.message is deprecated in Python 2.6 and gone in 3
* Use tuples with str.endswith(), supported since Python 2.5