psa: Use application key ID where necessary

Avoid compiler errors when MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER
is set by using the application ID type.

    [Error] psa_crypto_slot_management.c@175,9: used type 'psa_key_id_t' (aka 'psa_key_file_id_t') where arithmetic or pointer type is required
diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c
index fe92148..59be319 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -278,15 +278,17 @@
             ++stats->volatile_slots;
         else if( slot->attr.lifetime == PSA_KEY_LIFETIME_PERSISTENT )
         {
+            psa_app_key_id_t id = PSA_KEY_FILE_GET_KEY_ID(slot->attr.id);
             ++stats->persistent_slots;
-            if( slot->attr.id > stats->max_open_internal_key_id )
-                stats->max_open_internal_key_id = slot->attr.id;
+            if( id > stats->max_open_internal_key_id )
+                stats->max_open_internal_key_id = id;
         }
         else
         {
+            psa_app_key_id_t id = PSA_KEY_FILE_GET_KEY_ID(slot->attr.id);
             ++stats->external_slots;
-            if( slot->attr.id > stats->max_open_external_key_id )
-                stats->max_open_external_key_id = slot->attr.id;
+            if( id > stats->max_open_external_key_id )
+                stats->max_open_external_key_id = id;
         }
     }
 }