Refactor pastebin plugin
Switch to a reentrant mutex lock, fixes #25

Also increase the IRC wait timeout.