memheap: add some debug facilities

Check early and check often. Use rt_memheap_check to check the sanity of
a heap and use rt_dump_heap to get the scene of crime. I also add some
assertions to make the error explicit before doing destructive things.

You can control rt_memheap_check by RT_MEMHEAP_CHECK and rt_dump_heap by
RT_DEBUG_MEMHEAP_DUMP. You can have a more stronger check by defining
RT_MEMHEAP_CHECK_CIRCLE to catch the circular lists. The default setting
is having RT_MEMHEAP_CHECK but not RT_MEMHEAP_CHECK_CIRCLE and
RT_DEBUG_MEMHEAP_DUMP.