text: Title: Make xonsh tolerant to inaccessible xonsh data paths
  Body: <!--- Provide a general summary of the issue in the Title above -->
  <!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
  please first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html
  If you don't find an answer there, please do open an issue! -->
  
  ## xonfig
  
  <details>
  
  My distro is actually NixOS.
  
  ```
  $ xonfig
  +------------------+--------------------+
  | xonsh            | 0.15.1             |
  | Python           | 3.11.8             |
  | PLY              | 3.11               |
  | have readline    | True               |
  | prompt toolkit   | 3.0.43             |
  | shell type       | prompt_toolkit     |
  | history backend  | json               |
  | pygments         | 2.17.2             |
  | on posix         | True               |
  | on linux         | True               |
  | distro           | unknown            |
  | on wsl           | False              |
  | on darwin        | False              |
  | on windows       | False              |
  | on cygwin        | False              |
  | on msys2         | False              |
  | is superuser     | False              |
  | default encoding | utf-8              |
  | xonsh encoding   | utf-8              |
  | encoding errors  | surrogateescape    |
  | xontrib          | []                 |
  | RC file 1        | /etc/xonsh/xonshrc |
  +------------------+--------------------+
  ```
  
  </details>
  
  ## Expected Behavior
  <!--- Tell us what should happen -->
  Xonsh runs, though giving up logging command history to file.
  
  People need a shell for data rescue if they mess up their filesystem and can only mount it read only.
  
  ## Current Behavior
  <!--- Tell us what happens instead of the expected behavior -->
  Xonsh keeps throwing errors on an `open(...)` call and I cannot input anything except pressing \<c-C\> to exit the shell.
  
  <!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error
  To enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.
  On Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->
  
  ### Traceback (if applicable)
  
  <details>
  
  I havn't yet tried readonly `~/.local/share/xonsh`, but I set `$XONSH_DATA_DIR` to `p"~/ro"` where I build up a readonly overlayfs, and got the following output (and now I understand why it is generating infinite logs: I set xonsh as my login shell and it keeps falling back to itself on error)
  
  ```
  /etc/xonsh/xonshrc:16:16 -     source-bash "/nix/store/ml2wn9nd7p5912ynfxq27dwlkh77qx1m-set-environment"
  /etc/xonsh/xonshrc:16:16 +     ![source-bash "/nix/store/ml2wn9nd7p5912ynfxq27dwlkh77qx1m-set-environment"]
  Traceback (most recent call last):
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/main.py", line 469, in main
      args = premain(argv)
             ^^^^^^^^^^^^^
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/main.py", line 409, in premain
      env = start_services(shell_kwargs, args, pre_env=pre_env)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/main.py", line 355, in start_services
      _load_rc_files(shell_kwargs, args, env, execer, ctx)
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/main.py", line 310, in _load_rc_files
      XSH.rc_files = xonshrc_context(
                     ^^^^^^^^^^^^^^^^
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/environ.py", line 2492, in xonshrc_context
      status = xonsh_script_run_control(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/environ.py", line 2553, in xonsh_script_run_control
      exc_info = run_script_with_cache(filename, execer, ctx)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/codecache.py", line 169, in run_script_with_cache
      update_cache(ccode, cachefname)
    File "/nix/store/3sgwcszkn0c5ab5nwm0k1iga4shj2ps0-python3-3.11.8-env/lib/python3.11/site-packages/xonsh/codecache.py", line 98, in update_cache
      with open(cache_file_name, "wb") as cfile:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  OSError: [Errno 30] Read-only file system: 'ro/xonsh_script_cache/nix/store/hy8zfhlx9rjwws4w62bjdk5ix9x550q1-etc-xonsh-xonshrc.cpython-311'
  Xonsh encountered an issue during launch
  Failback to /run/current-system/sw/bin/xonsh
  ```
  
  </details>
  
  ## Steps to Reproduce
  <!--- Please try to write out a minimal reproducible snippet to trigger the bug, it will help us fix it! -->
  1. make ~/.local read only (maybe through mounting an overlayfs)
  2. start xonsh
  
  ## For community
  ⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**
  