Security enhancement - do not allow directories in tftpd.

In addition, a bug was fixed: two errors were sent through the listening socket, since the client socket was not created yet.