Fix RDP race condifion, fixes #394 (missing HAVE_LIBVTE), removed unused function