Use a heat shield. It is not worth burning your bed down.
X2 - Cheap insurance
The radiant heat from the exhaust pipe can still "see" the wood and will heat it up. Safe distance? Maybe 3 feet?

The critical thing with a heat shield, is it needs to stand away from the wood to be effective. If you slap a piece of sheet metal right on the wood, it will still get too hot.