api: Improve error catching in vim_eval