ARROW-3586: [Python] Add test ensuring no segfault
ARROW-3586: [Python] Add test ensuring no segfault

As reported in ARROW-3586, a conversion to categorical on an empty array
would trigger a segfault. This test ensure it is safe to do.

Author: François Saint-Jacques <fsaintjacques@gmail.com>

Closes #3116 from fsaintjacques/ARROW-3586-segfault and squashes the following commits:

7f779f1bf <François Saint-Jacques> ARROW-3586:  Add test ensuring no segfault

pcmoritz/arrow,xhochy/arrow,renesugar/arrow,kou/arrow,cpcloud/arrow,renesugar/arrow,itaiin/arrow,kou/arrow,laurentgo/arrow,tebeka/arrow,renesugar/arrow,itaiin/arrow,cpcloud/arrow,kou/arrow,renesugar/arrow,apache/arrow,tebeka/arrow,xhochy/arrow,laurentgo/arrow,tebeka/arrow,itaiin/arrow,apache/arrow,icexelloss/arrow,renesugar/arrow,itaiin/arrow,laurentgo/arrow,itaiin/arrow,icexelloss/arrow,pcmoritz/arrow,renesugar/arrow,laurentgo/arrow,kou/arrow,pcmoritz/arrow,majetideepak/arrow,pcmoritz/arrow,wesm/arrow,cpcloud/arrow,renesugar/arrow,icexelloss/arrow,laurentgo/arrow,apache/arrow,majetideepak/arrow,icexelloss/arrow,majetideepak/arrow,xhochy/arrow,icexelloss/arrow,wesm/arrow,xhochy/arrow,apache/arrow,apache/arrow,itaiin/arrow,majetideepak/arrow,wesm/arrow,cpcloud/arrow,icexelloss/arrow,renesugar/arrow,xhochy/arrow,icexelloss/arrow,tebeka/arrow,tebeka/arrow,xhochy/arrow,kou/arrow,majetideepak/arrow,laurentgo/arrow,apache/arrow,apache/arrow,itaiin/arrow,majetideepak/arrow,icexelloss/arrow,majetideepak/arrow,majetideepak/arrow,cpcloud/arrow,pcmoritz/arrow,apache/arrow,pcmoritz/arrow,pcmoritz/arrow,apache/arrow,xhochy/arrow,wesm/arrow,cpcloud/arrow,apache/arrow,wesm/arrow,laurentgo/arrow,majetideepak/arrow,apache/arrow,laurentgo/arrow,wesm/arrow,majetideepak/arrow,majetideepak/arrow,tebeka/arrow,tebeka/arrow,laurentgo/arrow,icexelloss/arrow,kou/arrow,wesm/arrow,itaiin/arrow,wesm/arrow,icexelloss/arrow,xhochy/arrow,itaiin/arrow,itaiin/arrow,renesugar/arrow,wesm/arrow,kou/arrow,icexelloss/arrow,renesugar/arrow,xhochy/arrow,laurentgo/arrow,renesugar/arrow,wesm/arrow,icexelloss/arrow,cpcloud/arrow,majetideepak/arrow,cpcloud/arrow,itaiin/arrow,cpcloud/arrow,xhochy/arrow,tebeka/arrow,pcmoritz/arrow,xhochy/arrow,pcmoritz/arrow,pcmoritz/arrow,wesm/arrow,cpcloud/arrow,kou/arrow,renesugar/arrow,wesm/arrow,laurentgo/arrow,laurentgo/arrow,xhochy/arrow,kou/arrow,icexelloss/arrow,kou/arrow,kou/arrow,xhochy/arrow,cpcloud/arrow,icexelloss/arrow,laurentgo/arrow,apache/arrow,kou/arrow,pcmoritz/arrow,cpcloud/arrow,kou/arrow,tebeka/arrow,laurentgo/arrow,wesm/arrow,pcmoritz/arrow,majetideepak/arrow,itaiin/arrow,majetideepak/arrow,laurentgo/arrow,cpcloud/arrow,xhochy/arrow,renesugar/arrow,apache/arrow,cpcloud/arrow,pcmoritz/arrow,renesugar/arrow,xhochy/arrow,wesm/arrow,pcmoritz/arrow,majetideepak/arrow,itaiin/arrow,itaiin/arrow,itaiin/arrow,kou/arrow,pcmoritz/arrow,tebeka/arrow,renesugar/arrow,apache/arrow