refactor structure of ``rtc_module.c`` to make it more clearly. Closes https://github.com/espressif/esp-idf/issues/1517