lgamma: unify branch correction code; speed up series code when n <= 2