Imports and watchonly behavior are legacy wallet only, so make them only run when the test is in legacy wallet mode.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/18788 | core#18788]] [5/16]
https://github.com/bitcoin/bitcoin/pull/18788/commits/a42652ec10c733a5bf37e418e45d4841f54331b4