dohtml: restore behavior noted in bug #425214

A trailing slash cause os.path.basename() and os.path.dirname() to
behave differently, causing foo/ to behave similarly to the way that
foo/* behaves. This behavior was broken by normalization in commit
3f67cb453ee1b74894c230459b43855db7fcc410.