Fix problem with handling deleted log directories

OTP-10855