gateway: call `Return` if call to `BuildFunc` returns an error.
gateway: call `Return` if call to `BuildFunc` returns an error.

Reorder the code slightly so that an error returned by the call to the
`BuildFunc` is picked up by the `defer`d error handling.

Signed-off-by: Ian Campbell <a8db091655a7f47ecb9c39a2d278e9662e440dc0@docker.com>

tonistiigi/buildkit_poc,tonistiigi/buildkit_poc