Added lock flag to prevent data races on LinuxI2C module