Throw at most one exception in native FileTest.

Test: atest CtsLibcoreTestCases:libcore.java.io.FileTest
Change-Id: I658b7f73e14ff5ef74f9b41fb0fb597c0325060a
diff --git a/luni/src/test/native/libcore_java_io_FileTest.cpp b/luni/src/test/native/libcore_java_io_FileTest.cpp
index 7cc6568..759d808 100644
--- a/luni/src/test/native/libcore_java_io_FileTest.cpp
+++ b/luni/src/test/native/libcore_java_io_FileTest.cpp
@@ -37,18 +37,22 @@
   int ret = stat(subDir.c_str(), &sb);
   if (ret == -1) {
       jniThrowIOException(env, errno);
+      return;
   }
   if (!S_ISDIR(sb.st_mode)) {
       jniThrowException(env, "java/lang/IllegalStateException", "expected dir");
+      return;
   }
 
   ret = stat(subFile.c_str(), &sb);
   if (ret == -1) {
       jniThrowIOException(env, errno);
+      return;
   }
 
   if (!S_ISREG(sb.st_mode)) {
       jniThrowException(env, "java/lang/IllegalStateException", "expected file");
+      return;
   }
 }