Fix for 2615 : deadlock in changelog trimming
When the changelog trimming meet a database Exception, it tries to close the DB
on which the problem happens.
Unfortunately the close waits for the trim thread to complete before returning.
We therefore end in a situation where trim thread deadlock itself.
Since it is also holding other locks at this point it causes a dealock of the whole
Replication Server.
The solution is simply to break the loop.
After this fix we still have to find the reason for the DB Exception.