Fixes a race in console.c