Fix the detection of the last dive.
Fix the detection of the last dive.

It looks like the Icon HD erases old dives partially with 0xFF bytes
before overwriting them with new dives. If the head of the oldest dive
has been erased, the length field which is stored in the first 4 bytes
is erased as well, and we can use it to detect the last dive.

venkateshshukla/libdivecomputer,Poltsi/libdivecomputer-vms,josh-wambua/libdivecomputer,henrik242/libdivecomputer,glance-/libdivecomputer,henrik242/libdivecomputer,glance-/libdivecomputer,josh-wambua/libdivecomputer,venkateshshukla/libdivecomputer