Merge two patches for cutting down EPIPE errors in nslcd into one, and try to cover other cases where the client doesn't flush its read buffer before hanging up on the server.