[lit] Remove uses of deprecated except syntax.

 - Since we only have a few of these, use the cumbersome method of getting the
   exception object from 'sys' to retain the current pre-2.6 compatibility.