Quoting, safety of test, exports.

* Safer test for empty/unset variable.

* Ensure MESOS_HOME is exported.

* Quote variables and process substitutions for safety.

* Expand `$@` inside quotes to ensure arguments with spaces are handled.