fix bugs: cvKeyWait() for ESC