The final stage of the collapse of a cavitation bubble close to a rigid boundary