Tunisia's Interior Ministry said an attacker had killed two police and two visitors while trying to reach a synagogue on the island of Djerba.