Here's an old fix for the problem. Don't know it applies now:
Clearing Caches to Fix Login Problem
You will need to type some Unix commands. If you are not comfortable with this, I don't know of anything other than a re-install. But if you are careful, you should be OK. I recommend you print this out in a largish mono-spaced font so you don't miss any spaces (or add extra ones). Note that case is important.
Be careful. Some of these commands are dangerous, since you are going to be root.
Start up in Single-user Mode. When this has finished you will see a prompt ending in '#', although there may be other messages. Enter the following commands after the prompt:
Press RETURN. Wait a few seconds for 8-10 lines of output. If the last line says repairs were carried out, repeat this command until you get a message 'The volume <yourdiskname> appears to be OK'. Then continue with:
/sbin/mount -uw /
rm -r *
rm -r *
Press RETURN after each command.
This should now take you to a proper login screen after the normal boot sequence. You should then Repair Permissions by using Disk Utility (in your /Applications/Utilities folder).
If it isn't applicable in your version of OS X, then I suggest:
Be sure you backup your files to an external drive or second internal drive because the following
procedure will remove everything from the hard drive.
Reinstall Lion, Mountain Lion, or Mavericks
Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
after the chime press and hold down the OPTION key until the boot manager screen appears.
Select the Recovery HD and click on the downward pointing arrow button.
Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu.
Repair the Hard Drive and Permissions as follows.
After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
Reinstall Lion/Mountain Lion, Mavericks: Select ReinstallLion/Mountain Lion, Mavericks from
the Utilities menu, and click on the Continue button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is
three times faster than wireless.
Kappy's advice is good and something you should follow.
However before you do eliminate your keyboard first. If you have access to a USB keyboard connect it to the USB ports on your MacBook Air and try again. If the password works then you may have have failing or failed keys or keyboard. If your laptop is under warranty take it your nearest Apple Repair Centre or Genius Bar. Be advised your warranty is void if the problem is due to a liquid spill.