Sometimes the unit tests leak memory (especially
test-session-item) because core is destroyed before all pending tasks are completed.
To solve this, a new
wp_core_pending() API has been added to check if core has pending tasks, and
test-base-fixture.h has been updated to wait until all tasks are completed before destroying core, making it easier to debug memory leaks in the future.