Intercept pipe server disconnect

The intercept pipe server will disconnect clients when the measurements
stream is complete. The client will handle a disconnecting server.
Refactor FileUpload

Removed code duplication from FileUpload regarding the Web Api client
code.