Re-raise async exceptions to cause a build failure

If an exception is caught while uploading the build context it is logged but
not re-raised. Because the upload happens in another thread, we need to
capture this in the main thread and re-raise.