I will be honest, it is only user input that can cause sharing of Applications/Music as you describe, so I am not sure how iTunes could be changed to stop it happening.
The operating system (whether Mac or Windows) comes with a Username and Password for each person and knows who do not want to share, simple do not give out their login password.
If you do share or leave your account logged in for others to use, then if someone logs into their iTunes store account whilst using someone elses iTunes or if someone uses anothers account to download content, iTunes would not really be capable of stopping it, and even if it prompt someone everytime they purchased to make sure they were using the right account, it would not stop people do so.
One area they have already acted to stop people switching iTunes Store accounts is that if you purchase from your iPad or iPod using one iTunes account, you can not switch to another on that device for 90 days. So maybe that will help in reducing people using family members accounts so much.
But to be honest, not really come across where this has happened 'by accident', as it takes several steps to carry out, not least people sharing their Account details.
You could also maybe change your password for your iTunes account, so your son is not able to use it (if that was what he had done).
It would also be interesting to know whether your account or your sons had download the App you refered to (right click and select Info will show the owner account) as this would allow you to determine at what point your son had added it to your iTunes, either downloading it via your account (changing your password would stop that) or he had imported it from his iTunes into yours (afraid the only way to stop that is to change your iMac login password and not tell him)
The OS update (a couple ago) which pushes new purchases to devices using that account, would not have down to your family devices or iTunes unless you shared the account (or had authorised his account in your iTunes) and also has to be turned ON, it is off be default. So again, it all comes down to the user and how they chose to use their computer/iOS device especially how they share log in details.