Fixed incorrect stdin flushing on Linux