tests: add basic thread safety unit test for plugins

https://github.com/quixdb/squash/issues/47

Signed-off-by: Evan Nemerson <evan@coeus-group.com>
Fix some issues clang's static analyzer complained about.

The one in squash/buffer-stream.c is legit.

Signed-off-by: Evan Nemerson <evan@coeus-group.com>