[pipe] Make read() to return 0 once, before blocking
[pipe] Make read() to return 0 once, before blocking

Also: make read() to never block (and return 0) when there are no more writers
and the whole buffer has been read.

Minor: handle the simple corner case of size=0 both for read() and write().

vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs