commit.c: make find_commit_subject() more robust