Repository: godot
Issue: Crash when removing the drive where the project resides (flickery USB connection issue on hardware)
Labels: bug,topic:editor,crash

### Godot version

v4.0.alpha.custom_build [475592a3b]

### System information

Linux Fedora, Radeon RX 590

### Issue description

If the USB connection is flickery (I think my USB are a bit old and dead) then Godot can crash if it fails to read files.
Stacktrace below:

```
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha.custom_build (475592a3bc2d2150dcbd9179fff653e3c55505a1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[1] /lib64/libc.so.6(+0x3ea70) [0x7fe725ddea70] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[2] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x1d8771c] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
ERROR: Condition "getcwd(real_current_dir_name, 2048) == nullptr" is true.
   at: DirAccessUnix (drivers/unix/dir_access_unix.cpp:507)
ERROR: Condition "getcwd(real_current_dir_name, 2048) == nullptr" is true. Returning: ERR_BUG
   at: change_dir (drivers/unix/dir_access_unix.cpp:345)
[3] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x1d8f749] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[4] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0xb180c9] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[5] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x45458dd] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[6] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x4314cc7] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[7] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x45416bc] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[8] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x45419bc] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[9] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0x29d7f79] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[10] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0xab6a56] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[11] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0xa8a929] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[12] /run/media/aria/WorkData/Projects/godot/bin/godot.linuxbsd.opt.tools.64() [0xa7e22e] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[13] /lib64/libc.so.6(+0x29550) [0x7fe725dc9550] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[14] /lib64/libc.so.6(__libc_start_main+0x89) [0x7fe725dc9609] ()
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Input/output error
[15] /run/media/aria/Wo
```

### Steps to reproduce

Open a project that is on an external drive and disconnect it.

### Minimal reproduction project

_No response_