Unify pending object and clear expired items from pending queue
Motivation
This PR unifies the pending and callbacks objects in the Pending struct for better tracking/access.
This PR also adds additional logic to properly clear the items from the Pending queue. Previously, we would clear the expired callbacks, but not clear the items from the pending queue; this leave an artifact in the queue for every unique element that was not removed explicitly.
In addition, we were only clearing items when an insert, remove, or num_callbacks function was called for that particular item. So if for any reason, the nodes are unable to complete the pending request, the item/callbacks will stay in the queue until the node is restarted.
The new changes will properly clear the expired items and periodically clear the pending queue of the expired callbacks and items. This should mitigate the incremental memory growth and also the redundant requests issue.
The CALLBACK_EXPIRATION_IN_SECS was also updated to prevent truncation, which should address the case where the callback expired but the fetch timeout hasn't.
Related PRs
https://github.com/AleoHQ/snarkOS/pull/3088