I will have to say food is more important, because everyone and everything needs some sort of food to survive.
Safety is important as well, but I think if you can find a way to isolate yourself from the majority of humanity and wildlife, you have a good chance of surviving without worrying too much about your safety.
Yoda exiled himself to Dagoba to escape the Empire, so he was relatively safe from harm (at least from Vader & Co.)...but he needed food to survive.
Without food, there's no hope, and no escape from hunger.
You can be safe from harm to a certain extent, but if you're hungry...wouldn't you still be in trouble? Not from the outside world, but from starving to death? (depending on how hungry you are and how long you've gone without eating something)?
And yeah, I guess you wouldn't know that whatever food you need to eat is safe, but in order to survive, you gotta do it.
Yeah, gotta go with the food.