Only rewrite line when value changed to compensate for output buffers being slow