Fixed bug of crashing using Keyboard actor

On MacOS Catalina std::queue does not check for non-emptyness on pop().
It led to size became equal to (uint64_t) (-1) and crash when emptying
the Keyboard events queue because in LockedQueue::dequeue we always popped.
8 jobs for master in 4 minutes and 27 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #15958
linux
build:linux

00:01:24

passed #15957
mac_old
build:mac

00:02:01

passed #15956
win32
build:win32

00:01:08

passed #15955
winxp
build:winxp

00:01:39

 
  Dist
passed #15962
linux
dist:linux

00:00:16

passed #15961
mac_old
dist:mac

00:01:39

passed #15960
win32
dist:win32

00:00:16

passed #15959
winxp
dist:winxp

00:00:14