lib/genalloc: add a helper function for DMA buffer allocation