Optimise wakeups for STM
As discovered while debugging #15544 (closed), the previous attempt at optimising STM wakeups (Phab:D4961, merged as 502640c9) broke other things (see comment 17) and reverted in D5144. This is the tracking ticket for this issue.
To summarize the problem: when a thread from capability 2 is in wait list of a TVar and we update the TVar in capability 1 we send a wakeup message to capability 2. If before capability 2 actually wake ups the thread capability 1 updates the TVar again we send a message again, causing redundant wakeup message sending. Ideally we should somehow mark the TSO as "awoken" and not send wakeup messages more than once. D4961 did exactly this, but in a wrong way (updated a field of TSO that shouldn't have been updated).