text: Title: Enabling `trace on` creates erroneous traceback
  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>
  
  ```
  +------------------+-----------------+
  | xonsh            | 0.13.1          |
  | Python           | 3.10.5          |
  | PLY              | 3.11            |
  | have readline    | True            |
  | prompt toolkit   | 3.0.30          |
  | shell type       | prompt_toolkit  |
  | history backend  | json            |
  | pygments         | 2.13.0          |
  | 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          | []              |
  +------------------+-----------------+
  ```
  
  </details>
  
  ## Expected Behavior
  <!--- Tell us what should happen -->
  
  No exception and traceback in the output
  
  ## Current Behavior
  <!--- Tell us what happens instead of the expected behavior -->
  <!--- 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` -->
  
  When setting `trace on` an exception is raised and a traceback is produced
  
  ### Traceback (if applicable)
  
  <details>
  
  ```
  Exception ignored in: <function _removeHandlerRef at 0x7f6872497f40>
  Traceback (most recent call last):
    File "/home/gn/anaconda3/envs/xonsh/lib/python3.10/logging/__init__.py", line 836, in _removeHandlerRef
    File "/home/gn/anaconda3/envs/xonsh/lib/python3.10/site-packages/xonsh/tracer.py", line 87, in trace
  TypeError: 'NoneType' object is not callable
  ```
  
  </details>
  
  ## Steps to Reproduce
  <!--- Please try to write out a minimal reproducible snippet to trigger the bug, it will help us fix it! -->
  Any MWE with using `trace on` e.g. run the following `xonsh test.xsh`
  
  ```sh
  $cat test.xsh
  #!/usr/bin/env xonsh
  
  $XONSH_TRACE_SUBPROC = True
  trace on
  
  echo "OK"
  ```
  
  ## For community
  ⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**
  