This makes the functions handle "xx/" and "xx/." as equivalent. Moreover, now path_extract_directory() returns normalized path, that is no redundant "/" or "/./" are contained.