Fix pack instantiation with function types.

Make sure we correctly expand packs which expand to another
pack in a function type.