Bug 995116 - [Tarako][MMS][Gallery] SMS/MMS OOM after attach a large pixel picture from gallery r=azasypkin

This patch does the following changes:

* adding an image to a composer that contains already other images needs to
  resize all images. With this patch, we do this sequentially. (already in
  master)
* we use -moz-samplesize to decode the images to resize them
* we try to free data more aggressively