Fix require_package()

Make it possible to refer to the created package resource in the calling scope.

Change-Id: I723673cbf486f82da3a3c616074fc005ffa80761