Refactor message handling for lower latency

- ThreadMessageHandler woken up by events that require it
- TRY_LOCKs replaced with LOCKs to limit worst-case delays
- Trickle behaviour split into separate thread
- SendMessages() split in two: original now only handles cs_main-dependent work