Fix 2 issues with Profile->Edit Environment dialog
- Correctly handle when user removes all lines
- Correctly handle when user OKs Edit Env dialog and then reopens same dialog before closing Edit Profile dialog.
Thanks to ahmadsamir for patch.
Differential Revision: https://phabricator.kde.org/D8921
(cherry picked from commit eaccb7dc612e385f38ed5ca01281f28f151120fc)