Write selected env variables to .stackenv

There are some environment variables that are derived in stack.sh
and cubersome to re-create later, so save them at the end of stack.sh
for use by other supporting scripts, such as openrc.

Change-Id: I1bbf717b970f8ceac0ff7da74aeaf19474997e07
diff --git a/openrc b/openrc
index 2553b4a..3ef44fd 100644
--- a/openrc
+++ b/openrc
@@ -26,6 +26,11 @@
 # Load local configuration
 source $RC_DIR/stackrc
 
+# Load the last env variables if available
+if [[ -r $TOP_DIR/.stackenv ]]; then
+    source $TOP_DIR/.stackenv
+fi
+
 # Get some necessary configuration
 source $RC_DIR/lib/tls