Fix installation for filtered packages

The calls added in 638df292a46b and 2c136c44845 will result in exceptions
if the packages aren't there because they have been filtered out due to
a restricted license.

Change-Id: I8cda906ab2fc5519c9110d91b21b915404de439b
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>