Adds a small check to close the issues only if the referencing commits are on the default branch. Fixes: #2314.