We tend to think of stock bubbles as bad things but, as the dotcom craze shows, good things can come from them, says Matthew Lynn