Improved record id extraction from field 003@$0.

The new code handles record ids properly if they are at the end of the
record and not terminated by a field or subfield delimiter.