Use the same environment in Loader and BuildGraphLoader.

Otherwise we can get false positives for environment changes, resulting
in unnecessary re-resolving.

Change-Id: I12c35bca8341a5664c88030c8533979e3751bd1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Fix exception leak in JS command execution.

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