Merges https://github.com/espressif/esp-idf/pull/3222
Works around bug reported on forums where any source file ending in *lock.c or *creat.c was being linked to IRAM. https://esp32.com/viewtopic.php?f=13&t=8909&p=37362#p37362 Also moves all related functionality to newlib component.