i2c: Add a length check to the SMBus write handling