wcsp-test: Add improved lame_hash function

The original function was absolutely terrible. This one is *much*
better, hashing perfectly across all 1-bit errors. I worked it out
by just experimenting with it for about an hour.

I dislike the branch... but GCC emits CMOV on x86 and obviously uses
conditional MOV's on ARM, so I don't think it's a huge problem. In any
case, a slower decent hash function is preferable to a terrible fast one.