[ADT] "Inline" TestAndEraseFromMap into PriorityWorklist.h (NFC) (#156596)
TestAndEraseFromMap is used only from PriorityWorklist::erase_if.
This patch "inlines" the struct into its sole user in the form of a
lambda function, eliminating a lot of boilerplate code.