Convert to using a task execution listener rather than a doFirst closure for the uploadArchive task.

This will now support DeferredConfigurables such as those used by the
maven-publish and ivy-publish plugins.