engines/e_devcrypto: fixes logic in close_devcrypto