Remove no more needed command_write_input function.

The input writing can be done direct with vb_echo_force() instead.
Extracted some duplicate logic from vb_echo* functions.