Create method to control worker auto-restart mechanism

Create possibility to switch off worker auto-restart mechanism when it is needed.
Improve creating worker ID, use default system temp dir, which can be also changed with environment variables, and get rid of creating a hardcoded directory, which can be confusing when running daemond from different system users.