Static and dynamic heterogeneities in a model for irreversible gelation