Adds conditional for closing coverage in retrieve_oob

There is a chance that _get_coverage could fail and if it does then
coverage is not defined when it reaches the finally block to close the
coverage, this patch addresses this case.