proto-shell: pass the return code of the proto task to the teardown handler