Clear buffer before calling pipeline.

Ensure to clear the buffer when the pipeline throws RuntimeException.
Copy buffer if needed on IOStage
Add empty check
Add toString()
Add @Ignore for an unstable test