fill in missing library id field for read pairs
avoid endless while loop and use signed arithmetic to detect inconsistent values