Attempt to be more robost in face of data loss

Lower layers of protocol stack now look out for missing data, and try to
inform the higher layers of the stack explicitly when this has happened.