Non-analytic finite-size corrections in the one-dimensional Bose gas and Heisenberg chain