Implement blocking pipe

Blocking pipe is a pipe where reads and writes are synchronized.