[NamedPipeReader] made reader implementation more bullet proof, still needs a lot of cleanup