freerds: prevent race condition and protocol error on screen resize