Stop further keymap state traversal after a miss.

In theory this further traversal can only lead to trouble when an
operator is forgotten in the keymap states. In practice this might
occur, so stop this from happening as extra foolproofing.

Added extra test, though this isn't for the problem described above.

Fixes #415.