Fix NPE in very rarely used stdin/stdout console mode caused by accessing a variable when it hasn't been set yet.