Fix garbage return value on error

If str contains invalid characters, ret is not initialised. Caught by
Clang static analyzer.
Fix overly long assertion string

With GCC 4.9.1 I get a -Woverlength-strings warning:
hivex-internal.h:123:23: error: string length ‘3823’ is greater than ...
   (STREQLEN (((struct ntreg_hbin_block *)((char *) (h)->addr + (offs)))->id, (eqid), 2))

The compile command can be shortened to:

    cd lib && cpp -DHAVE_CONFIG_H -I.. -I../gnulib/lib  -I. \
        -Woverlength-strings -Werror -g -O2 write.c

After that, be amazed at the huge assertion string produced by the
macro which is also visible in libhivex.so (two times).

To fix that mess, use an inline function. The `STR*` macros were moved
and a string.h header added since STREQLEN is used in the function.