update hmac signature comparison

see https://docs.python.org/2/library/hmac.html#hmac.compare_digest
support Python older than 2.7.7
minor cleanup
warn users running older versions of Python
update comment

@ivanov is making the commit, but Kyle helped compose it, so he gets
points! Everything is awesome when you're part of a team!
Merge pull request #6114 from ivanov/update-digest-api

update hmac signature comparison