A sufficient condition for the continuity of permanental processes with applications to local times of Markov processes and loop soups