(#15202) Handle paths with files in them
When creating the install path, if there is a file in the way then there
was an unhandled exception. This commit extracts out a install directory
handling code for ease of testing and adds handling for this case.
This class excapsulates the logic of preparing the installation
directory for modules. As we find more operations on the installation
directory we should try to move them to this class.