[Misc] Fix test-cta-valgrind failures in objectstore/scheduler
Description
This commit fixes several valgrind and helgrind errors reported after upgrading from c++17 to c++20.
Checklist
-
Documentation reflects the changes made. -
Merge Request title is clear, concise, and suitable as a changelog entry. See our contributing docs
References
Closes #1308 (closed)
Edited by Konstantina Skovola