The BBC has been criticised for removing a Horrible Histories episode that featured slavery, chimney sweeps and Victorian child workers.