build-logs: delay creation till we have a commit

If we delay log creation until we have a commit hash then it will be
included in the log filename (instead of "unknown")