Status badge shows "FAILED" for a branch with "Running" jobs

I found{user}/{repo}/tree/{branch}.svg?style=svg shows “FAILED” when the branch has a “Running” job. Because we check our build status using status badges for 100-ish branches, it’d be helpful if this issue doesn’t exist.

I found some related topics, but all of these were closed while not resolved: