Make image build script optionally record build tag on disk
For automation, it makes life easier when building images and executing
the tests in a row to record the image build tag in a file. We thus add
a --write-env-file optional argument to build_images.sh that will
record SWH_IMAGE_TAG at the given path in the format of an environment
variable definition.