Fix race for sending_allowed

Sending_allowed use sync_in_process. If sync_in process is set in the
middle of sending_allowed and api->handler_fn_get, results are
unpredictable. Solution is to enlarge lock.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
schedwrk: Set values before create callback

When totem callback is called before setting value, NULL can be called,
resulting in segfault.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Remove exit thread and replace it by exit pipe

When exit is called, exit thread will create schedwrk. This usually
works, but sadly there is race between main thread (coropoll) and this
thread in totemsrp_callback_token_create (main thread is reading values
and iterate thru list and exit thread is adding to list).

Solution is to remove exit thread. Create pipe and connect one end to
coropoll (so main thread) and let corosync_shutdown_request simply write
byte (= create notification) to coropoll, which executes shutdown
sequence.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>