MB-12609 Limit key length to <block size> - 256 bytes

- Also modified the key length used in long_key_test().

- This is a temporary fix; addressing MB-11766 will be a generic
solution that resolves the issues on key length.

Change-Id: I88b84ad35eb19de94b983eda579ef68eaf64e860