Record extra information as environment variables

For now we are adding last exit code and jobs count.

We need to pass these from the shell instance, because they're not available
outside it.