[FELIX-3414] Fix problems with the refreshPackages which does not wait for the refresh to be completed. This is a simple workaround (which may not always work) that should improve the situation waiting to leverage the new osgi wiring api.