Undo input buffer code removal

It shouldn't have been removed in the first place, since it's reponsible for
converting incomplete sequence into characters. A temporary helper function was
added to replace the `read(2)` call in the `fill_input_buf` function.