[PATCH stable 5.15] lib/buildid: Fix build ID parsing logic