Fix RELEASE-FOREGROUND in case of "dead" thread as NEXT argument