Adding test for getting stuck in a loop.

One problem with this hard decsion bit flip decoding algorithm is that it can get stuck in a loop flipping the same bits back and forth. A test for this was added and when this condition occurs, one randomly chosen bit from the set will be flipped. This seems to help performance.

This test is not exhaustive. Other signatures that I have seen are flipping bit a, then bit b, then bits a and b together, then back to bit a.... So there is potential for more robust checks.