Clean up temp dir in failure cases

Change-Id: Icfb99a09726c01e96ff14967afbafa4116e02eff
Signed-off-by: Dave Barach <dbarach@cisco.com>
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index 475e3dc..d479da3 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -127,6 +127,7 @@
 
 	  if (mount ("none", (char *) mount_dir, "hugetlbfs", 0, NULL))
 	    {
+	      rmdir ((char *) mount_dir);
 	      err = clib_error_return_unix (0, "mount hugetlb directory '%s'",
 					    mount_dir);
 	      goto error;
@@ -136,6 +137,8 @@
 
 	  if ((fd = open ((char *) filename, O_CREAT | O_RDWR, 0755)) == -1)
 	    {
+	      umount2 ((char *) mount_dir, MNT_DETACH);
+	      rmdir ((char *) mount_dir);
 	      err = clib_error_return_unix (0, "open");
 	      goto error;
 	    }