Evolutionary contingency in lingulid brachiopods across mass extinctions