Note that the large threaded locknut and top race on the threaded part of the headset has nothing to do with the connection with the handlebar, which uses a stem quill into the steerer tube (See the Sheldon's site for details). You tighten up the top race/locknut only if you feel "looseness" between the handlebars/fork and the frame.
If you can move your handlebars separately from your fork, you have to tighten up your stem quill more using that little hex bolt. Sheldon again has a wonderful diagram of the wedge bolt.
An allen key may not be giving you enough torque -- you may want to use a hex bit on a socket wrench or torque wrench. You'd have to give us the specs on the hex bolt for us to look up the appropriate amount of torque -- but it's certainly more than you could get with an allen key. But be careful of using a socket wrench as that may give you so much torque that you snap the bolt or split the steerer tube -- the use of a torque wrench is strongly recommended.
It sometimes helps if you can take the quill stem out, use alcohol to remove any residual oil off of the wedge. You can also rough up the outside of wedge a bit with a file. Some people also use coarse grit (lapping compound) or carbon-fiber assembly paste to increase the friction and reduce galling risk.
You may want to grease the hole at the top of the stem quill where the wedge bolt enters as well as the surfaces between the quill and the wedge to reduce friction. If the bolt has a habit of loosening itself, you could use blue Loctite on the bolt threads.
But the main problem is that with BSOs, the tolerances are so poor that something is either too tight and galled into place, or so sloppy that no end of tightening will get you solid tight without breaking something else. And sometimes the drones at the factory do something truly idiotic like put a 25.4mm stem into a 26.00 steerer tube.