Add a control lock mutex for protecting certain control variables.
Set the control lzma properties only once.
Rewrite the magic if we receive lzma properties and have not yet written them yet during stdout operation.