Merge pull request #1986 from libgit2/rb/error-handling-cleanups Clean up some error handling and change callback error behavior