Restore contexts when doing mkdierhier in libtar
Do a restore of loaded file contexts to /data/media directory. This will help denials to be prevented when internal storage is wiped.

Change-Id: Ie49bbfa48d2f3ee4f08376d9c1877b92c051017c
diff --git a/libtar/extract.c b/libtar/extract.c
index 8081aa2..d9ab788 100644
--- a/libtar/extract.c
+++ b/libtar/extract.c
@@ -159,11 +159,14 @@
 	if((t->options & TAR_STORE_SELINUX) && t->th_buf.selinux_context != NULL)
 	{
 #ifdef DEBUG
-		printf("    Restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
+		printf("   Restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
 #endif
 		if (lsetfilecon(realname, t->th_buf.selinux_context) < 0) {
 			fprintf(stderr, "Failed to restore SELinux context %s!\n", strerror(errno));
 		}
+		if (lsetfilecon(dirname(realname), t->th_buf.selinux_context) < 0) {
+			fprintf(stderr, "Failed to restore SELinux context %s!\n", strerror(errno));
+		}
 	}
 #endif