Bug 1023685 - Support writing encoded zero-byte strings in OS.File.writeAtomic. r=yoric

Patch originally created by KeyboardFire <andy@keyboardfire.com>.
Bug 1056373 - Add the ability to sample each allocation by some probability. r=jimb