Make abuf more robust in dealing with truncation.
Merge branch 'PhilipHomburg-more-robust-abuf'