Optimize (~x1.4 speedup) :meth:`fractions.Fraction.from_decimal` and
:meth:`fractions.Fraction.from_float` for :class:`~decimal.Decimal` and
:class:`float` inputs, respectively.  Patch by Sergey B Kirpichev.
