[runtime] Fix malloc backend for mempools.