prevent undefined values in finally block

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
Merge pull request #226 from ceph/wip-7714

prevent undefined values in finally block