gh2666: terms_gcd does not remove and _keep_coeff doesn't hold 1.0

In addition, if only a 1 (or 1.0) is extracted, the original
expression is returned from terms_gcd rather than the polys-modified
form (e.g. 2.0*x + 3 instead of 2.0*x + 3.0).