hyp2f1: more stable handling of arguments close to 1

https://github.com/scipy/scipy/issues/1561#issuecomment-20554407 points out an issue with the hypergeometric function for a large negative value for `b` and a value for `x` close to 1. This problem can be fixed by evaluating the ratio of the gamma functions via the logarithm of gamma functions. Then, the ratio of two gamma functions  can be evaluated much more reliably even for large arguments. The chances to obtain `nan` are greatly reduced. 

I propose this change because it improves the evaluation of hyp2f1 even though it seems to cause problems with the test `check_cdf_ppf` in the `stats` module. Unfortunately, I am not yet sufficiently familiar with the `stats` module to propose a solution there. May be somebody else can see more clearly what is going wrong in the `stats` module.