imported ptp* from libgphoto2

lots of buffer overread checks
diff --git a/src/libmtp.c b/src/libmtp.c
index 7bb5a7e..dfd77b7 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -1863,6 +1863,7 @@
   memset(current_params, 0, sizeof(PTPParams));
   current_params->device_flags = rawdevice->device_entry.device_flags;
   current_params->nrofobjects = 0;
+  current_params->cachetime = 2;
   current_params->objects = NULL;
   current_params->response_packet_size = 0;
   current_params->response_packet = NULL;