The reason for locking suspension uphill is efficiency converting the power you produce into forward momentum. If you are losing forward momentum by slipping, its because you have too much power going to the rear wheel. This needs to only be for a very short (instantaneous) burst. Once traction is lost, it takes a lot to regain it. Give this, there is no benefit in locked out suspension under these situations.
So, all else being equal, uphill slippery conditions set suspension as hard as you can without slipping. On tree roots, that is probably as soft as it will go.
Technique is really important. You need to ride smoothly and in control of power. You need to predict when the rear wheel is rolling over the tree root and reduce power till over it. High cadence helps as long as you can maintain smooth power. Use momentum to carry you over the root, power up when you have traction and power down before you loose it. Reduce weight on the wheels as they hit the tree root to allow it to roll over smoothly (critical on a hardtail, but helps with softtails). Ideally don't hit a root with front and back at the same time, pick your path to avoid it.
Lifting front wheel and loss of control is caused by too much torque (power) on the back wheel - the same smooth controlled power delivery to climb roots will prevent this. Depending on your bike setup and riding style, you will eventually get to the point you cannot ride up the hill without lifting the front wheel.
Front suspension should not be pushing up fast enough (rebound) to cause you to lift the wheel. If it is, adjust you rebound (if you have it). If the trail is ride able, you won't topple backwards unless you do something silly and are completely out of control.