That makes LEDs flicker at 50Hz or 60Hz. It is best to connect two LEDs back-to-back then connect those in series and in series with a current-limiting device. Then the LEDs protect each other and the flicker is at double the frequency which is not as irritating.However there is no problem simply placing a suitably rated rectifier diode in series with the LED lamps. By suitably rated I mean one that can handle the current. This will simply block the reverse half cycles and protect the LEDs. On the forward half cycles it will pass current and if a low drop type is chosen will not lose to much voltage.