BUG-5280: Close client history after all histories are closed