Do you need the ads to be displayed in real time? Like ambrus says, you could append ads to a randomly selected file in a certain range, like newads1.dat through newads10.dat, then set up a cron tab to run a utility every so often that goes through the files, merges the records, appends them to the master file, and deletes the newads files (or renames and moves them, just in case). This would eliminate the flock problem (just increase the range on the file numbers until you no longer are losing ads), and would also prevent you having to open each of the separate files every time you wanted to display ads. Even the cron job wouldn't halt your ads, since you wouldn't need all the files locked simultaneously, just the one you were currently loading.
I hope the ads don't need to be editable, once submitted?