Return a typed `context.Canceled` error following the context package
semantic.
Closes: #1854
Might break existing users if they rely on the current error string
being returned with string matching, which is unlikely though.
Signed-off-by: Michael Gasch <mgasch@vmware.com>
By default raised SIGPIPE signal will cause the program to exit immediately[1]
and bypass any shutdown logic.
Add syscall.SIGPIPE to the signals we get notified to disable this behavior.
[1] https://golang.org/pkg/os/signal/#hdr-SIGPIPE
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>