CA-140596: Failed Lock cannot be garbage collected

The IOError exceptino was already there, so I am not asking you to cehck if it was the right exception to raise but,
yes, adding new custom exception that are not following the usual scheme is not a good idea.