Hopefully fixes #23646.
This makes a few changes to feature_init (along the lines of the discussion here: #23289 (review)). The changes are detailed in the specific commits, but a summary might be:
- more robust log-line detection (at the expense of maybe being slower)
- retain all debug.log content
- perturb .ldb files in a more complete way