[5.0] Reintroduce ServiceProvider::when(), which allow registering/loading service provider only when events is fired.

Signed-off-by: crynobone <crynobone@gmail.com>
I wonder if it was simply a mistake in the first place? Anyhow, this is very minor - not much point in discussing it, or changing it.