Fixed test where cleanup actually did not happen.

As we intentionally induced an exception. Cleanup
put into finally block.