mfreerdp: fix possible crash on gdi termination