Fix fatal error crashing slave on database connection failure