ui_paste: Use sys.stdout.write() instead of print

* Resolves and issue where an extra new line was printed at the end the
  output.