wasm-linker: write magic bytes only on success

By writing them at the very end, we can easily detect
where the writing of the binary went wrong as tools will
indicate the missing of the magic bytes.
a01b1448e2Luuk de Gram committed on 9/12/2022, 7:19:13 PMparente323cf1
1 file changedLine totals unavailable