spiced-random: port from buffer_create to buffer_create_on_heap
spiced-random: port from buffer_create to buffer_create_on_heap

and introduce goto for simpler resource handling

FSMaxB/molch,FSMaxB/molch,FSMaxB/molch