sys: Add generic pipe

This PR adds a generic pipe. You can write to it and read from it.
If the pipe is empty and one reads from it, then the threads gets laid to sleep. Same for writing.
The implementation takes care of interrupts, and won't send the current thread sleeping in an ISR.