lz4-example: log any error during encode/decode
Ensure compatibility with reference decoder.

In some cases, go-lz4 was producing data that wasn't decodable with the
reference C implementation.  We were failing to respect the following
two conditions:

1) The last 5 bytes are always literals
2) The last match cannot start within the last 12 bytes

This patch updates the encoder to follow these two rules.

No test case, unfortunately :(

Fixes #15.