sha1: run-time check for endianness

WORDS_BIGENDIAN is never defined what breaks sha1 on big-endian
architectures. Instead, make run-time check.
sha1: compile-time endianness check for some compilers

Newer gcc and clang provide macro __BYTE_ORDER__.