examples/simple-httpd.c: Fix handling of directories
A bug introduced in commit 53a3dd24 (a copy/paste mistake has replaced a variable name) causes the example httpd to not handle directories correctly.
This patch fixes this.
Additionally, we add a comment recommending programmers to provide a descriptive error message. This could give users and programmers a hint as to what went wrong.