TW-27930 Fixed npe during wait reason creation when no locks are acquired on the resource
(cherry picked from commit 7d3690c)