Fix waitKey() on Linux.