Fix crash handling a request for a directory

When there is a request for an existing directory, the tool tries to serve this as a file which results in an exception: ... `in 'send_file_data': : 1 Is a directory (IOError)`

The pull request adds a check for this.