Serialize empty arrays and objects without newlines