heap: make compatible with non-OS builds, remove target dependence Closes IDF-1236 See merge request espressif/esp-idf!7051