generate-tar: Always remove scratch dir

Add a trap to generate-tar to remove the scratch dir on exit,
otherwise the scratch dir was not being removed if the script
failed before it reached the end where the rm command was.

Tested: Verified the scratch dir was removed on failure.

Change-Id: I177201976d19d5b7a44a909090739f7e74f75320
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/generate-tar b/generate-tar
index d90aefa..f0b94a9 100755
--- a/generate-tar
+++ b/generate-tar
@@ -124,6 +124,7 @@
 
 
 scratch_dir=`mktemp -d`
+trap "{ rm -r ${scratch_dir}; }" EXIT
 
 if [[ "${do_sign}" == true ]]; then
   if [[ -z "${private_key_path}" ]]; then
@@ -243,4 +244,3 @@
   echo "Static layout tarball at $outfile"
 fi
 
-rm -r "${scratch_dir}"