std.format: Make double to string conversion @safe

Bonus optimization: avoid redundant and possibly-unsafe strlen
Merge pull request #2494 from CyberShadow/pull-2014-09-07-11575425

std.format: Make double to string conversion @safe