lakka: Guard against the possibility of realloc failing