Shellcheck fixes for define_build_environment_variables
Shellcheck fixes for define_build_environment_variables

- "SC2039: In POSIX sh, string replacement is undefined."
  https://github.com/koalaman/shellcheck/wiki/SC2039
- "SC2086: Double quote to prevent globbing and word splitting."
  (related to usage of `$CIRCLE_SHA1`)
  https://github.com/koalaman/shellcheck/wiki/SC2036
- Export all variables defined, based on "SC2034: ECR_DEPLOY_IMAGE
  appears unused. Verify use (or export if used externally)."
  https://github.com/koalaman/shellcheck/wiki/SC2034

Exporting the variables allows us to use the script directly instead of
sourcing it, so we can add the `-u` argument, which means "Treat unset
variables as an error when performing parameter expansion.".

ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public