Ticket #3011: mc under x11 problems with mouse or hang due gpm

mc may not detect the gpm mouse under X11 on many x terminals when running together with tmux or screen.

On some cases it can even hang.

It's a small patch to the gpm maintainer to improve its checking.
Seems there is a need also to a small change on mc.

Now everything is working perfectly.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Merge branch '3011_mc_gpm_and_xterm'

* 3011_mc_gpm_and_xterm:
  Ticket #3011: mc under x11 problems with mouse or hang due gpm