Fix detection of directory entries in the inventory.
check_inventory_shape allows you to check that an inventory entry is a directory by ending it in a '/'. However the code to add the '/' to the entries for comparison uses the kind == 'dir' to detect directories, when the key is 'directory'.