[PATCH 6.6 342/386] lib/buildid: harden build ID parsing logic