CORE-4258 Fixed folder rename logic.

Fixed folder rename bug in ClientDataModel (introduced in 1dbc71c6f0ea31c999c991385c6d23a8d52deb33 for CORE-3944).
Updated rename logic in DataMainPanel (added in commit dbf453e533ff5100758ffaed28cd8cf320fb2fbe for CORE-2798) so that it's compatible with these fixes.