(PUP-3391) Plugin syncs incorrect environment while agent is resolving environment

Before this commit if an agents environment was changed the plugins from
the initial environment were synced instead of the plugins from the
environment where the node would end up. This would cause problems where
a manifest from one environment would be applied with custom types and
providers from a different environment.

This commit changes the behavior to sync plugins after every environment
resolution. We need to sync the plugins after every environment change
because this action needs to be performed before we can retrieve a
manifest for the node in a particular environment.