scd: Fix possible NULL deref in apdu.c