test/crypto: close device after tests