fix crash recovery bug in PopularUrlsTest

Currently the test does not increment page count after relaunched
after a crash. This means the crashed page will be loaded again,
causing a dead loop.

Change-Id: If4591fbd05521f0454151affafec09788e9208d9
diff --git a/tests/src/com/android/browser/PopularUrlsTest.java b/tests/src/com/android/browser/PopularUrlsTest.java
index b1760e9..547cb9f 100644
--- a/tests/src/com/android/browser/PopularUrlsTest.java
+++ b/tests/src/com/android/browser/PopularUrlsTest.java
@@ -307,7 +307,6 @@
 
         public void write() throws IOException {
             FileWriter output = null;
-            OutputStreamWriter writer = null;
             if (mFile.exists()) {
                 mFile.delete();
             }
@@ -317,14 +316,8 @@
                 output.write(page + newLine);
                 output.write(url + newLine);
             } finally {
-                try {
-                    if (writer != null) {
-                        writer.close();
-                    }
-                } finally {
-                    if (output != null) {
-                        output.close();
-                    }
+                if (output != null) {
+                    output.close();
                 }
             }
         }
@@ -394,6 +387,7 @@
 
         if (mStatus.getIsRecovery()) {
             Log.e(TAG, "Recovering after crash: " + iterator.next());
+            mStatus.incrementPage();
         }
 
         while (mStatus.getIteration() < loopCount) {