Properly compute the best share (endianness issues)

See https://bitcointalk.org/index.php?topic=61731.msg1386248#msg1386248