I took apart a shimano deore crankset to clean it once, and what i did notice was that there are very slim brass washers between the chain-rings bolt holes. I lost one, but re-assembled the crank without that one washer. I havent had any probs with it coming loose. Maybe these washers are missing from your crankset? I wonder if that is the reason your middle ring came loose in the first place?