Fix bug with empty Wasm file when using system binaryen for optimization
Created by: cmichi
@ascjones The regression which you found is unfortunately a bug which was introduced when making the binaryen
dependency opt-in.
I've added a number of asserts now and fixed it.