Update screen if necessary and release the lock so receiveThread can run

def validator(ch):
    """
    Update screen if necessary and release the lock so receiveThread can run
    """
    global screen_needs_update
    try:
        if screen_needs_update:
            curses.doupdate()
            screen_needs_update = False
        return ch
    finally:
        winlock.release()
        sleep(0.01) # let receiveThread in if necessary
        winlock.acquire()