Kill pthread usage

We cannot use pthread since irssi uses fork() for various features.
WIP: Refactor key generation worker code