ks_resize() canonicalises the stored string

It ensures the string is NUL-terminated, especially in the case that
ks_resize(&kstr,1) has been used on a newly-created kstring_t to ensure
that kstr.s is not NULL.
Only canonicalise if there is room, and add docs

We could increment SIZE to ensure there would be room, but that would
disadvantage people using kstrings for binary data in power-of-2-sized
blocks.  Instead document that SIZE=KS.l+1 will ensure NUL-termination.

This fixes a bug in the previous version when the l<m invariant does not
hold (kputc_()/etc and manual manipulation only maintain the weaker l<=m);
hattip Rob Davies.
Add kstring_t init/destroy documentation

Ideally these could be provided as ks_init()/ks_destroy(),
but those names are already in use with kstream_t.
Merge pull request #21 from jmarshall/kstring

Make ks_resize(&kstr,kstr.l+1) useful for ensuring the string is allocated and NUL-terminated
revert a change to ks_resize()

due to a mistaken merge
removed incorrect comments
parallelize simple "for" loops
parallelize simple "for" loops
remove
working, but locking is slow
use test-and-set for spin lock
for C++ compatibility
Merge branch 'master' of github.com:attractivechaos/klib
fixed a typo
forgot to remove debugging code

which causes bugs
more comments
let the main thread help the unfinished workers
documentation; better var names
no effective changes
bugfix: wrong integer type

but it does not really matter