typos
detect when the pipe handle is invalid
continued on the road to update the socket state with an error, but finding out that it's already in done state
simplify the test