Invalid keys shouldn't cause a crash

Keys of the form name-notdigits will cause the validation to crash.

In theory this is a security issue because an attacker could submit an
arbitrary form with keys in this format.

Not sure if this is the correct way to solve the problem, though.