Heavy rain in Serbia and Bosnia has caused rivers to flood, killing some and forcing thousands to flee as the water rises and landslides bury homes.