No callers use the returned value in first_invalid. Remove it from the
function signature and don't set it in the function.
Partial backport of Core PR15921 : https://github.com/bitcoin/bitcoin/pull/15921/commits/c428622a5bb1e37b2e6ab2c52791ac05d9271238
Depends on D6873 only to be lint-free.