X: avoid processing events before mode is set

This avoids possible crash on startup.