JBIDE-15373 Check all code run by builders for thread safety

Fixed code that failed with a big probability at adding/removing
CDI nature to projects in wildfly.