Closes https://github.com/espressif/esp-idf/issues/8287 Closes https://github.com/espressif/esp-idf/issues/7921
When not compiling bootloader, a spinlock will be used for reading or writing I2C internal devices/registers. When compiling for bootloader, no need to use any lock.