Remove dead code from NativePosixFiles and unix_jni.

RELNOTES: None.
PiperOrigin-RevId: 242683431
diff --git a/src/test/java/com/google/devtools/build/lib/unix/NativePosixFilesTest.java b/src/test/java/com/google/devtools/build/lib/unix/NativePosixFilesTest.java
index cca0b4b..3bcbd91 100644
--- a/src/test/java/com/google/devtools/build/lib/unix/NativePosixFilesTest.java
+++ b/src/test/java/com/google/devtools/build/lib/unix/NativePosixFilesTest.java
@@ -106,7 +106,9 @@
   public void throwsFilePermissionException() throws Exception {
     File foo = new File("/bin");
     try {
-      NativePosixFiles.setWritable(foo);
+      NativePosixFiles.chmod(
+          foo.getPath(),
+          NativePosixFiles.lstat(foo.getPath()).getPermissions() | FileStatus.S_IWUSR);
       fail("Expected FilePermissionException or IOException, but wasn't thrown.");
     } catch (FilePermissionException e) {
       assertThat(e).hasMessageThat().isEqualTo(foo + " (Operation not permitted)");