It seems newer devices need more weird empty transfers in order to function.
The Loke protocol supports 32-bit unsigned for the size of files being flashed. However, POSIX file commands only support 32-bit (signed). As such we now have platform specific support for larger files.
When using --stdout-errors, the messages written to stdout contained garbage. Inside vfprintf(), each va_arg() consumes one entry from the va_args. Trying to use the same va_args variable again results in undefined behavior as subsequent va_arg() invocations continue to read from memory past the actual variable space. Instead, a copy has to be made with va_copy() and this be used for outputting to stdout.