wlfreerdp: add keyboard and mouse wheel support, fix bugs

This commit does the following:

* fix the keyboard logic (which now fully works), add support for vertical mouse wheel events ;
* make the rendering a lot more efficient, by using RDP damage information to refresh only the relevant part of the buffer ;
* fix two race conditions. wlfreerdp should not crash anymore now ;
* fix shm_open() and shm_unlink() calls ;
* improve the code style.

Signed-off-by: Manuel Bachmann <tarnyko@tarnyko.net>
Merge pull request #2232 from Tarnyko/master

wlfreerdp: add keyboard and mouse wheel support, fix bugs
tsg: fix segfault

Revert false positive from commit 585d9101b752e4ec525339e5c5addfddb519760d
buffer shouldn't be freed since it is set and used in a stream.
crypto: revert pull request #2130

The fix in #2130 eliminates the problem when connecting over a gateway
but introduces other problems server side and client side (client/server
can't detect anymore when a TCP connection was closed).
transport: handle all return values of tsg_read

tsg_read can also return 0 which means that no data (complete PDU) is
currently available. This case wasn't handled properly.

Fixes #2056
tsg: unwind recursion in tsg_read