Add final newline.
Use queue.Queue and call sync for now to avoid crashes.