GeanyPy: Fix a possible NULL-pointer issue reported by cppcheck

This patch might fix an issue with a possible null pointer dereference marked out by cppcheck.