Allocate memory and count gas for RETURN instruction

[#79942174]