set profile name from profile_dir

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

closes #4238
Merge pull request #4880 from minrk/profile-name

set profile name from profile_dir