Comparison of thermal and hydrothermal lignin degradation. Reactions mechanisms and a strategy for lignin recovery