Prevent db sync thread from blocking exit