fix thread-safety for delegate array access and delegate calls