cat: improve the performance of the last line when dumpfile() by adding output buffer instead of frequent system call

Signed-off-by: C.W. Hsiao <cwhsiao.lionel@gmail.com>