I've bisected now, but during my testing I realised that the problem didn't go away. Instead, it just took a bit longer to reproduce.
I discovered that a very effective way to reproduce the issue is just to start several threads at the same time, so I simply extended the test case to the following: