close leaking slave fd after setting up pty magic