Don't use fprintf to output D strings since they might contain embedded nulls.

Instead, use fwrite to output the string in its entirety. It's probably
more efficient this way anyway, since we bypass format string parsing in
fprintf.
Update unittest to check for correct writing of embedded nulls.
Merge pull request #2334 from quickfur/issue8730

std.stdio.writeln should write strings with embedded nulls correctly