all.sh: improvements

- add quotes to the $@ parameter in helper_crypto_client_build()
- instead of copying mbedtls_config.h to build static libraries,
  we rely on the already existing backup/cleanup mechanism which
  is available in all.sh.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 2f4ee25..fbe9523 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -951,8 +951,6 @@
     shift
     TARGET_LIB=libpsa$TARGET
 
-    cp $CONFIG_H $CONFIG_H.bak
-
     if [ "$TARGET" == "client" ]; then
         scripts/config.py full
         scripts/config.py unset MBEDTLS_PSA_CRYPTO_C
@@ -978,10 +976,12 @@
         scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT
     fi
 
-    make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB $@
+    make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB "$@"
 
-    rm $CONFIG_H
-    mv $CONFIG_H.bak $CONFIG_H
+    # cleanup() will restore some backed-up files which include $CONFIG_H and
+    # $CRYPTO_CONFIG_H. Built libraries were already copied to psasim at this
+    # point.
+    cleanup
 }
 
 ################################################################