Don't forget to SetLastError() on disconnection

Otherwise if the last error was a ERROR_NO_DATA we have no indication that
the pipe has been closed.
Merge pull request #1902 from hardening/pipeFix

Don't forget to SetLastError() on disconnection