libcommuni.pro: cleanup file writing

Use the built-in write_file() on Qt 5, and provide a system() based
substitute for Qt 4.