Only install directories if the source is actually a directory.

Refs #9681
Merge remote-tracking branch 'origin/feature/9681_non_dir_python_bundle_mac'