Added an API to retrieve the current run/build environment

Needed in order to provide the correct run environment when starting a
product from within Qt Creator.

Change-Id: Iaa1356845daf485d7f4b361a76b559b0b7339ee7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>