smarthttp: Improve error handling and validation for PostUploadPack
This MR improves error handling and validation for the smarthttp.PostUploadPack RPCs. This is done with a flake in mind that we see every now and then which is almost impossible to debug because we don't verify error messages in this particular code.