added a test for unintended graph connection removal during add_trait
Merge pull request #1583 from naylor-b/deriv_error_check

added a test for unintended graph connection removal in add_trait during replace