mini-os: fixed compiling with debug=n

Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
"memset" is doing a memset operation and tries to make it call the
standard "memset", creating a loop.

gcc complains that nodedepth may be uninitialised, so set it to -1 by
default.

Don't include string.h; use lib.h instead.

Signed-off-by: Thomas Leonard <talex5@gmail.com>