I have been fighting this issues for 2 days now. I started a completely new project to confirm suspicions as well. The code appeared to work correctly last night, immediately creating the files as it is supposed to do. This morning, excited to get back to it and complete my project, it is right back to not creating the files until I use sys.exit() to end the program. Using the stop button to end the program does not generate the files either. Running the same script on my local installation generates the file immediately, allowing the program to function as it is supposed too.
This appears to be a limitation in the virtualized IDE, and I think I will develop locally first, then see if I can get it to run normally on GDB.