The S&P 500 and gold are both rallying, with stocks nearing a return to record territory. Why the assets could diverge when the shutdown finally ends.