Store triggered build environment variables

Save TRIGGERED_BUILD_NUMBER and, if blocking, TRIGGERED_BUILD_RESULT to
the build environment. Prior to this change, it was necessary to parse
the log file, which was very hacky and only possible on the master. This
can be used by later build steps and downstream jobs.