What happens to a tailed beast if it's Jinkiurichi is killed while he still has the tailed beast inside of him/her?
If the Jinchuriki is killed then the chakra of the tailed beast disperses and after a while reforms somewhere else.
It was stated that the Bijuu will disappear from the world for a while, and then reappear at some later time.
This was first said by Kushina on the day of the Nine-tails' attack that "I'll drag him down with me to death, that will buy us some time until it revives".
It was then later reinforced on several occasions that killing a Jinchuuriki without extracting the Bijuu will make it reappear at a later time in an apparently random place.