Fix segfault on bad input string, instead returning None.
Merge pull request #2 from dnschneid/master

Fix segfault on long strings