Recover auto commit setting before close connection.