BUG: fix NULL dereference on longdouble conversion error

Closes gh-627
Merge pull request #4294 from juliantaylor/fix-longdouble-int

BUG: fix NULL dereference on longdouble conversion error