text: Title: `mitmproxy --scripts broken.py` with a broken script does not properly handle the error and leaves terminal in a funny state
  Body: #### Problem Description
  
  I've noticed that when loading a broken script (e.g. syntax error) mitmproxy won't properly exit or keep running and show the error in the event log, as it does when live reloading a script.
  
  #### Steps to reproduce the behavior:
  
  broken.py
  
  ```
  x
  ```
  
  1. `mitmproxy --scripts broken.py`
  
  In the screenshot you can see that it initially rendered the UI and then exited. However:
  
  1. There is no error message
  2. The terminal is in an inconsistent state. Whatever I type does no appear and ctrl+c does not "repair" it.
  
  ![image](https://github.com/mitmproxy/mitmproxy/assets/679144/dabfcf97-6641-49e0-ba23-cb5f7b61568c)
  
  This happens with 10.2.2. With 10.0.0 I get a clean exit with
  
  > Error logged during startup: error in script broken.py
  
  #### System Information
  
  ```
  Mitmproxy: 10.2.2 binary
  Python:    3.12.1
  OpenSSL:   OpenSSL 3.1.4 24 Oct 2023
  Platform:  Linux-6.5.0-21-generic-x86_64-with-glibc2.38
  ```
  