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.

*[edit]* This PR is (re)based on ~~#933~~ #1101. *[/edit]*
would make `pipe_t *` more sense as a first argument - I mean you always want to read/write to a pipe, right?