refactor: Do not discard try_lock() return value
Summary:
Microsoft's C++ Standard Library uses the [[nodiscard]] attribute for try_lock(). See: https://github.com/microsoft/STL/blob/main/stl/inc/mutex
It appears the same issue occurs with GCC 13.1.
Backport of core#26189.
Test Plan:
With debug and GCC 13.1:
ninja all check-all
It should return no warning.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D14005