Try to create a fake tty and reset fd settings when deleting.