Device-independent two-party cryptography secure against sequential attacks