A previous refactoring introduced an issues in SimulatedProcessThread causing stalls when task are posted. This CL fixes this and cleans up the code to make it easier to see that it's correct. Bug: webrtc:11255 Change-Id: I33d7daa993ad2a4cfe2b63f674692455c2e09d05 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167380 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30429}