build_wrapper: Refactor injection of examples

Add a new handle_examples_injection() function to handle all
the injection of the examples in one place.

This function is only called for desktop builds, so excluding
Android and iOS.

Change-Id: I2461ea8953782c8c1d2f8c920ea7ce76958fa479
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>