psa_export_key: for raw-byte keys, zero the end of the output buffer

Skip all writing to the target buffer if its size is 0, since in this
case the pointer might be invalid and this would cause the calls to
memcpy and memset to have undefined behavior.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index eac1eb4..87f9147 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -864,8 +864,12 @@
     {
         if( slot->data.raw.bytes > data_size )
             return( PSA_ERROR_BUFFER_TOO_SMALL );
-        if( slot->data.raw.bytes != 0 )
+        if( data_size != 0 )
+        {
             memcpy( data, slot->data.raw.data, slot->data.raw.bytes );
+            memset( data + slot->data.raw.bytes, 0,
+                    data_size - slot->data.raw.bytes );
+        }
         *data_length = slot->data.raw.bytes;
         return( PSA_SUCCESS );
     }