Adds round-down to the nearest power of 2

Can also use the Xen macros, if you're interested (__RD32).
Atomic pipes

Similar to pipe, but for in-kernel transfer and synchronization.  You
can't use them from IRQ context.  See apipe.h for info.
Fixes bug in sys_pipe()

Under some circumstances, a writer could block and then never wake up.