close slave_fd after getting ttyname