Determine the age of the local `HEAD` first and only if it is older than
24 hours proceed with the much more expensive `git ls-remote` to check
if there are any new upstream commits (there usually will be).
This keeps the overall logic unaltered, but significantly speeds up the
check for users that have recently updated (still slow for all others).
ClosesHomebrew/homebrew#48499.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>