How can I avoid tearing the valve loose from an inner tube with a wheel lock?
A bike I sometimes borrow has one of these locks, and I can't say it's ever been a problem. You've given the answer in your question: Do not close the wheel lock between a spoke and the valve. If you're prone to forgetting this, what you need is a way to make the valve more obvious. I've had automatically illuminated valve caps before. That would do the trick, even in darkness, but the cheap ones I've used haven't been very waterproof. Alternatively putting a spoke-mounted reflector in that range of spokes might help. If even those don't stop you, something like tape between the spokes either side of the valve should prevent you locking up on the bit of the wheel, but might get in the way of the valve and will almost certainly end up making a mess.