Add a space if the key ends on a space, even if the value is empty

RT testing showed that this variant is more common, even if the value is
actually empty. Follow the data.

Change-Id: Ic694de7967ef8ae31880229f2e0d2d021694ec23