What did they do before on-board toilets?
Go to the toilet before departure, and hope you can find somewhere to land if nature calls suddenly :)

Same really as before a long car journey today...

Of course aircraft of that time didn't have very long endurance, so the situation wasn't likely to arise that you'd need to make a pit stop to let nature take its course. You'd have a scheduled stop anyway well before that.