improve excn printing
Summary:
This diff changes two things...
(1) The Exception.clean_stack method used to only preserve filenames of the form ".../hack/src/...", but dune builds produce stack filenames of the form "src/...". This diff changes to accept the dune form as well.
THIS IS AN EXPERIMENT. I don't know if it will work out well. To explain the idea, look at this:
```
Called from Base__List0.fold in file "src/list0.ml" (inlined), line 21, characters 22-52
Called from Dune__exe__Fiddle.inner in file "src/ftrial/fiddle.ml" (inlined), line 13, characters 10-66
```
The conceit in this diff is that there's a small finite number of modules (like Base_List0.fold above) that come from stdlib-like, and all the rest must come from user code. The ones I've observed so far in callstacks are `Base.*, Stdlib.*, Lwt.*`. I figure there are probably just a small number of other stdlib-like modules, and I'll add them piecemeal, until we're done.
If I'm wrong about this, and over the coming weeks or months then there are just too many stdlib-like modules, then I'll have to give up on this approach.
(2) In jsonrpc.ml it used to have this code
```
let message = Printexc.to_string e in
let stack = Printexc.get_backtrace () in
```
but I discovered that the first call to Printexc.to_string had the potential to corrupt the global mutable stacktrace variable. This diff switches around the order so as to get the correct stacktrace.
Reviewed By: Wilfred
Differential Revision:
D34839234
fbshipit-source-id:
a24b68b5f230c433aec4ced123f76f7dbaa059c0