Add tmp directory inside python modular examples and direct all temporary
output to that dir. This fixes tests running concurrently that read the
files in the examples directory.