French intelligence agents have detained four people, including a former navy service member, on suspicion of planning a terrorist attack against "military installations," the country's interior minister said.