[tsan] Move some suppressions-related code to common.

Factor out code to be reused in LSan. Also switch from linked list to vector.