Update the wait code to use the more modern wait_event_freezable()
macros. If those macros are not available, fall back to the older
wait_event_interruptible macro, and build our own
wait_event_freezable on top of this.
These changes should simplify our interactions with the wait queue
and refrigerator bits of the kernel, as we're now using more standard
interfaces to them.