Bug 817568, 829518 - Enclose some API calls in __try...__except to suppress crash. r=mcmanus a=akeybl