Make abuf more robust in dealing with truncation.