Bugfix threadsave

Hello Rayed,

i had to fix some concurrent append call problems (discovered on our production system)

Since i have no also git, here the PR.
Greats Daniel