Wooden bed sidebar to headboard screws loose, wobbly joints
I'd think using the bolt designed for exactly this job would be the way to fix this, rather than following a poor design choice by whoever built the bed.

Bed Bolts are machine bolts (metal to metal threads) that mate with a cylindrical "nut" that goes into a drilled cross hole in the side rail. The bedframe to rail job is what they were designed to do (though they have other uses, once you are aware of them.) 



Further detail - OK, those are "modern" bed bolts, for some reason I more easily found images of "old" style bed bolts with normal square nuts, which are a huge pain to actually use in a wooden bedframe  than this "modern" style bed bolt pictured above.