how to flush stdin buffer in linux