tsan: refactor libignore implementation