Apply generated PORT to local env copy

This fixes a bug where the generated/dynamic PORT assignment was only working for the *first* process. The original code was writing to the shared envs and so for any subsequent processes/groups it would find the previous value and skip generation of the remaining ones.