Bug 840294: Check RIL validity before writing to socket; r=tzimmerman

--HG--
extra : rebase_source : 3fd48cad8cd3b06994972f420752c5676b2e68dc