Add LSBInitScript support

gitlab-autopull is an LSB init script to autostart daemon on boot. While adding the support I also found problems with
the daemon threads that caused the script to leave http threads haning after killing the main process. This has been fixed now as well.