SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation