Reformat README to markdown
Don't leak resources

Close the authorized file in _all_ cases, not just when authorized.

Found by coverity scan.
Fix typo

the "dir" parameter contains the name of the directory, while the "dirh"
variable is an opendir() handle that'll only be NULL in case of error.

By complete accident, this compiled, but it wouldn't actually ever do
anything useful.
Create Coverity model