Modified the service registry to use more fine-grained locking to avoid callbacks to service factories while holding locks. This complicates the implementation considerably, but should hopefully address FELIX-489.