[PATCH v2 4/5] mfplat/sample: Refactor sample_CopyToBuffer().