Segfault with pd.tslib.get_period_field FIX

Fix for issue 4519.