Avoid leaking ptm fd in case of an error
Avoid leaking ptm fd in case of an error

In func Pty, the ptm fd (pty master) is only wrapped into an *os.File at
the end of the function. Before that, ptm needs to be closed explicitly
in case of an error.

pkg/term