Nearly three years ago, a Saudi Arabian university student applied for a passport to travel to Syria or Iraq, where he hoped to join two cousins fighting for the extremist group now known as Islamic State.