Fix memory leak when fitting multinomial distribution

Replicate the fix on R-Forge 
http://r-forge.r-project.org/tracker/?atid=1813&group_id=443&func=browse by
Christophe Foussette