Should specify chunk_size when calling _write_message function

When starting again from the next device after connection been reset, the program should specify the correct `chunk_size` otherwise the whole process will be failed.