set profile name from profile_dir

in case profile_dir is set directly (e.g. in the notebook)

closes #4238