wakeup_source: fix use after free by refcounting

Adding a destructor function for a wakeup_source in
53a02e33a3cda1b2fa8feb8ae7402c2032907cf9 introduced a use-after-free.
Fully dynamically allocate struct wakeup_source and refcount it to allow
the lifetime to be nonfixed.

This allow the client of parse_wakeup_sources to not be required to free
each wakeup_source, but allows it to extend the lifetime of the object
by referencing it.
handle interrupted system calls

This program does not set any non-default signal behavior, but Linux's
idiosyncratic behavior with SIGSTOP can still cause EINTR to be returned
for that signal. There is no way to configure that signal to be ignored
or automatically restart, making SA_RESTART useless as a method to avoid
the programmer having to explicity handle EINTR.

Use glibc's TEMP_FAILURE_RETRY macro for all interruptible system calls.
make sleeps resume on -EINTR

This is only necessary if we have a signal handler, as nanosleep does
not return with EINTR for signals that do not have a handler.  We don't
currently handle any signals, but add this safety in case we add a
signal handler in the future.