Improving keyboard tests stability (synced with shell) - fixes #483