Maint: Added assertion to make sure Log.close_all succeeds
If the hash containing log destinations gets corrupted, Log.close_all
could fail silently. This change adds an exception to make these
failures easier to debug should they ever happen again.