NULL check various things in jsinfer (bug 837370, r=bhackett, a=bbajaj).