avoid set*id/setrlimit misbehavior and hang in vforked/cloned child