Add SetBlocking method.

When blocking mode is set, writing will never result in a truncated file.
Also write using blocks of 1MB maximum, and reduce write buffer from 128MB to 8MB.
Use 8MB write buffer in blocking mode, and 64MB in non-blocking mode

Ref #11801

(cherry picked from commit e667d38647a0fd2de5b1a5f5a6db844a13640b70)
Add methods to set blocking mode on all classes using a ThreadFileWriter internally

(cherry picked from commit a83f788b125f9b1e5f131b597a68bb69cb3a9c03)
Bump API

(cherry picked from commit c7fe63f4e485078a81c843f15187f406dffe9b65)
Make use of ThreadedFileWriter to tools requiring it

Fixes #11801

(cherry picked from commit b199ca363127637e91f4e3f968a9b296911355ee)