Fix sonar issue in distributed locking

Fixed sonar issue:
- Refactor the code of the lambda to have only one invocation throwing
  an exception

Issue-ID: POLICY-2616
Change-Id: I8d96b95d0da9a780daacec7a4de17167642b03c1
Signed-off-by: Jim Hahn <jrh3@att.com>
1 file changed