omega/occ: only open debug output file if there is any need