[mtp] Fix GetObjectHandles request with multiple storages

The request was returning duplicate handles when iterating over all storages.
[ptp] Use MTP_ASSOCIATION_TYPE_GenFolder for directories
[ptp] Stable order of object handles

This fixes a client problem where it showed only a random selection
of pictures from the device.
[ptp] Terminate data transfers according to PTP spec

PTP requires a 0-byte packet to be sent after a data transfer
if the transfer size was a multiple of the packet size.
This fixes a problem where certain files could not be imported
by iPhoto.
Merge pull request #25 from amtep/master

Increase compatibility with Mac PTP initiators (iPhoto, Image Capture)