PyModules: Create target directories explicitly
Create target directories explicitly before copying files into them.
According to the documentation of copy_directory
this should not be
necessary but our CI jobs say differently.
Fixes problems seen in !487 (merged), !470 (merged), etc.
Edited by Frank Winklmeier