Peru's foreign minister resigns after controversial remarks on terrorism