Correct off-by-one error and add delimiter support in build_lcp_array

Prior to this commit, delimiter characters (\000) would be counted as part of
substrings.  Non-ASCII characters would cause incorrect substring lengths, and
the final character in a text would not be counted.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>