E_INVALIDARG sometimes means OOM.

Gecko bug 996266
r=kamidphish
Merge pull request #6 from jdashg/invalidarg-oom

E_INVALIDARG sometimes means OOM.