You can localize it by playing the string lightly and placing your ear closely to the different contact points of the string to the hardware on the guitar. Start with the bridge, and move your way up the guitar to the nut and where the string meets the tuning machine peg.
Note: The terminology in the following paragraph can be ambiguous, as there are two kinds of nuts we are dealing with. There's the fretboard nut, and then a tuning peg nut which screws onto the shaft of the tuning machine to secure it in place on the headstock. I'll do my best to delineate between the two as clearly as I can.
Based on how you described it and fixed it (and I'd love to see a picture of that) the problem is likely an issue with your fretboard nut or a loose peg on the A string tuning machine. It seems that more tension on that length of string holds the culprit in place, thus fixing the buzzing. In order to find out the root problem, I would first test the tuning machine peg. Remove the string from the peg and first check for a loose nut--there should be one that holds the tuning peg securely to the top of your headstock for each tuning machine. If the machine nut is tight, then gently tap the headstock or the peg itself. If you hear a vibration or a knocking sound, then it is likely the peg. You can tighten most all tuning peg nuts with an adjustable wrench or an appropriate deep well socket. If after tightening the peg nut you still hear buzzing from the machine, then you might need to purchase some replacements (something could be broken inside the machine). In my experience, stock tuning pegs tend to be pretty cheaply built anyway--so I usually replace them on new guitars I purchase eventually.
Also, make sure the string trees are tight. These can cause a little buzzing sometimes--especially since a bass tends to be more violently resonant--lots of stronger vibrations travel through the body of the guitar.
If the peg checks out okay, then the issue could have something to do with the fretboard nut--in which case you should drop by a qualified guitar/bass tech or a luthier and get them to take a quick look.