Remove unused variable (fix 942f346b3a860ee043606ed80bb45d512843c1f1)
Change return types of parse_path & lookup_parent_id to unsigned

libMTP uses unsigned for folders and files.
0x0 & 0xFFFFFFFF are reserved.
for folders, 0x0 is the root of a storage.

This patch should not modify anything in the algorithm
Fix function reference error introduced by 384e820e037876ee4bfa28079af6be980cc0ad5e
Fix 'control reaches end of non-void function'
Fix error introduced by 085c2de26924ff7f17e6f59cf5d2f0a181fc6854
Fix a use after free
Add an assert
parse_path: protect 'directory' length
Explicitly specify casts, with assert protections