Feature/issue 333 fix gamma q chain

##### Summary:  What does this pull request do in general terms?

Fixes #333. Prevents an infinite loop in the derivative of the `gamma_q` function by throwing an exception. Removed duplicated code in `gamma_q`; calling function in src/stan/prob/internal_math.hpp instead.


##### Intended Effect: What is the expected effect of the pull request?  Specifically, indicate how the behavior will be different than before the pull request.

Instead of getting stuck in an infinite loop, throws a `std::domain_error`. This is done in internal_math.hpp, in the `stan::math::gradRegIncGamma` function.


##### How to Verify: How can reviewers verify the request has the intended effect?  This should include descriptions of any new tests that are added or old tests that are updated.  It should also indicate how the code was tested.

Reviewer can run two tests:
- `make test/agrad/rev/gamma_q`
- `make test/math/prob/internal_math`

2 additional tests in src/test/agrad/rev/gamma_q_test.cpp that triggered the infinite loop before the fix:
- one for (var,var)
- one for (var, double)
2 new tests in src/test/agrad/rev/internal_math_test.cpp
- one that should normal execution
- one that shows triggered the infinite loop before the fix


##### Side Effects:  Does the pull request contain any side effects? 

No.


##### Documentation:  If the pull request is user facing, how is it documented?  Are there examples of how to use the new behavior that users need to know about?

N/A. Internal math function.


##### Reviewer Suggestions:  Who should look at the pull request for code review?

@bob-carpenter: a question about efficiency. Is the check too expensive?