Fixes #21647
This PR fixes an issue where the importprunedfunds RPC only allowed importing
transactions that credit the wallet, but rejected transactions that spend from
the wallet.
This could lead to incorrect wallet balance in pruned or partially-synced setups where a spending transaction is missing: the wallet would remember receiving funds but forget that they were already spent.
The fix extends the check to also allow transactions that are IsFromMe().
A functional test is added to cover importing a spending transaction and ensure it is correctly accepted and restored to the wallet.