Corrected variable name collision.

The variable profile was used in 2 different scopes, and the profile
variable was refactored as profileEditor to disambiguate it from the
profile argument returned by onSave in the ProfileEditor dialog.