awful hack to get a possibly-failing ccall to work inside a try-catch