Skip key event when input purpose is password

This patch fix [CVE-2013-4509](https://bugzilla.novell.com/show_bug.cgi?id=847718). Please help to review and merge if it is okay, thanks.