REFACTOR combine train_wrap and csr_train_wrap

The dense liblinear train wrappers were almost entirely identical. It seems as a result that `csr_train_wrap` missed out on #1857; and this refactored form would make implementing changes like #1867 a little simpler.