[GHC] #10639: Optimization changes concurrent program's behaviour