make 'keep-alive' fork-safe and thead-safe

Fixes #55