rts: Timer causes races and eventlog corruption in non-threaded RTS
## Summary
Using `--eventlog-flush-interval` with the non-threaded RTS leads to eventlog corruption.
The cause of this is a race between the timer thread and the main thread:
- The timer thread [calls `flushEventLog`](https://gitlab.haskell.org/ghc/ghc/-/blob/master/rts/Timer.c?ref_type=heads#L122-129) which [flushes the eventlog buffer without *any locking*](https://gitlab.haskell.org/ghc/ghc/-/blob/master/rts/eventlog/EventLog.c?ref_type=heads#L1623-L1642).
- If this happens at the same time that the main thread is writing to the eventlog buffer, this leads to eventlog corruption.
Here's a sample corrupted eventlog: [my.eventlog](/uploads/6d3d47b96135b627ac8051761056f323/my.eventlog)
Note 1: The existence of this race implies there's another potential cause of eventlog corruption due to [the call to `handleProfTick`](https://gitlab.haskell.org/ghc/ghc/-/blob/master/rts/Timer.c?ref_type=heads#L111), which writes to the global event buffer without *any locking*. I have not yet attempted to produce this bug. This potential issue could be fixed by having `handleProfTick` write to a dedicated buffer or by using the global event buffer mutex in the non-threaded RTS. This potential bug is likely the cause of issue #25165, see @teo's [comment](https://gitlab.haskell.org/ghc/ghc/-/issues/26222#note_628608).
Note 2: There is also a race with `contextSwitchAllCapabilities`. However, I do not know of this causes any issues.
## Proposed Solution
I propose that we ban the use of `--eventlog-flush-interval` with the non-threaded RTS.
It might be possible to fix this issue by introducing mutexes, but I believe this would significantly complicate the RTS, ultimately only to support the use of `--eventlog-flush-interval` in the non-threaded RTS. It is insufficient to simply use the global event buffer mutex in the non-threaded RTS, since `flushEventLog` also flushes the per-capability event buffers. The per-capability event buffers are not guarded by mutexes, so in their case we cannot simply reuse existing code. Hence, this either it requires introducing a mutex for each per-capability event buffer, or it requires introducing the `acquire/releaseCapability` mechanism into the non-threaded RTS, with all the baggage that entails.
## Environment
* GHC version used: 9.12.2 and master
Optional:
* Operating System: macOS 15.5
* System Architecture: arm64
issue