libfreerdp-core: fix locking with TS Gateway