Fix the broken pipe error.

Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>