Update PublishApplication.ps1

Added code to wait for application pool to stop.