Modify set_exit_on_term

This implementation is not thread-safe and will cause harmful exit,
but at least it will not cause deadlock on exit.
Remove unnecessary errno

sigwait doesn't set errno
Remove calling sigprocmask in thread generated in set_exit_on_term

In pthread, child thread's signal mask inherits parent thread's one.
Use pthread_sigmask instead of sigprocmask
Fix servers (distributed mode) to block signals
Fix jubakeeper to block signals
Fix jubavisor to block signals
Refactor lock service
Add prepare_signal_handling and set_action_on_term