Fix a crash when running witout UI delegates.

Lookup the correct UIDelegates import path once lazily, and reuse
this information. If there is none, then we don't expect any UI
delegation to work, but it should not crash.

Change-Id: I73be7273d83b8d89b74641dc550341cf2b7eb602
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>