Two changes.
Do not allow ptrace(PT_TRACE_ME) if parent would not trace us. I.e. when the parent is init. Not init can be killed and then trace state of the process is cleared, while this does not work for pid 1 parent.
Do not ever suspend if thread_suspend_check is called with return_instead == 1. Suspending there causes us stopping while upper levels are not ready for the thread suspension.