Use string overload for writing out Uri

This ensures everything is properly escaped and quoted.