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

This patch does the following changes:

* we use -moz-samplesize to decode the images to resize them
* we try to free data more aggressively by using setTimeout

(Original patch from Steve Schung, then modified)
Bug 988268 - [Cost Control] 'When use is above' parameter is set to '0' the red line appearing at the top of the graphic
Bug 1006995 - Fix the failure of test_sms_to_dialer.py
Merge pull request #18793 from julienw/995116-attachment-reduce-memory

Bug 995116 - [Tarako][MMS][Gallery] SMS/MMS OOM after attach a large pix...
Merge pull request #19031 from bebef1987/sms_dial

Bug 1006995 - Fix the failure of test_sms_to_dialer.py
Merge pull request #17704 from gitmai/bug-988268-CC-limit-non-zero-add-invalid-css

Bug 988268 - [Cost Control] 'When use is above' parameter is set to '0' ...
r=jmcf
Merge remote-tracking branch 'upstream/master'