While that's conceivable, Merkle-graph systems like Bitcoin are surprisingly resilient. It's been almost 20 years since MD5 was thoroughly broken, but still nobody has published a second preimage attack. For SHA2 and SHA3 nobody has even published a collision attack. And SHA-256 (what Bitcoin uses) is post-quantum-safe (Grover's algorithm still needs 2¹²⁸ time) though AFAIK there isn't yet a post-quantum cryptosystem deployed for signing transactions, which will require a hard fork.
Presumably if quantum computers (or better DLP algorithms on classical computers) start breaking keys, that will become a priority.
So I think there's an excellent chance that even if the math is solved Bitcoins will retain their value. Perhaps even without many of them getting stolen in the process. This is a big difference from many other uses of cryptography; if someone breaks IDEA 20 years from now, they can decrypt your PGP messages from the 20th century, and there's nothing you can do now to prevent that.