argv0 isn't suitable as current_exe() in all cases.

Index: library/std/src/sys/pal/unix/os.rs
--- library/std/src/sys/pal/unix/os.rs.orig
+++ library/std/src/sys/pal/unix/os.rs
@@ -391,13 +391,13 @@ pub fn current_exe() -> io::Result<PathBuf> {
         cvt(libc::sysctl(mib, 4, argv.as_mut_ptr() as *mut _, &mut argv_len, ptr::null_mut(), 0))?;
         argv.set_len(argv_len as usize);
         if argv[0].is_null() {
-            return Err(io::const_error!(io::ErrorKind::Uncategorized, "no current exe available"));
+            return Err(io::const_error!(io::ErrorKind::Uncategorized, "no current exe available (null)"));
         }
         let argv0 = CStr::from_ptr(argv[0]).to_bytes();
         if argv0[0] == b'.' || argv0.iter().any(|b| *b == b'/') {
             crate::fs::canonicalize(OsStr::from_bytes(argv0))
         } else {
-            Ok(PathBuf::from(OsStr::from_bytes(argv0)))
+            Err(io::const_error!(io::ErrorKind::Uncategorized, "no current exe available (short)"))
         }
     }
 }
