test: stricten readline keypress failure test condition
This verifies that the thrown error is the expected one. That was not tested before.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines