[coreboot-gerrit] Change in coreboot[master]: amdfwtool: Extract out-of-bounds check to a function and move