verify that ttyname refers to the same file as the fd