Celtics agree to trade Pierce, KG to Nets