Fix directory middleware to properly work with '.'

This fixes the `directory` middleware to properly work when the directory is set to `'.'`. Before it incorrectly allowed users to climb the entire directory tree outside the directory. This also does *not* use `path.resolve` to work where a server cannot stat it's own parent directory (sort of common practice).

Fixes #771