Escape key was not being handled when no items are found in a search.

My only hesitation with this change is the comment:

 // does not make sense (and will crash) if ctrl.items is empty

I assume that it was referring to a null ctrl.items? I haven't noticed any issues with this change and now it handles the escape key.