Make ecdsa library compatible with python < 2.7

This is required for offline transaction signing to work natively on tails.