Use a static mutex to keep the console colors and context together when debugging with colors on Windows. Fixes #517231.