The meaning of convenient in these cases is pretty much the regular meaning: good for somebody because it makes their life better or easier in some way. In this case, it's "convenient" that Andy threw the gun in the river because doing so could have helped him avoid being convicted of the crime (which clearly would have made his life better or easier).
If you listen again to the dialogue, you'll probably notice that the speaker puts more emphasis than usual on the word "convenient". This is often done to suggest that one that does not believe something. In this case, the emphasis on "convenient" means the District Attorney is implying "I think you're guilty of the crime".
I hope this helps.