A fragile ceasefire appeared to be holding in South Sudan's capital Juba after four days of gun battles that have left hundreds of people dead and sent nearly 40,000 fleeing.