CRM-15365 Fixes to directories for Windows Servers

Fixes for CRM-15365 which involved problems when setting directories
through the UI when hosted on a Windows server