Added array_key_exists() check for get_defined_constants()

Added array_key_exists check to check for misconfigured environments. This happend to me on Google App Engine.

I've reported the problem to Google but to add some resilience to the library I've added a check.

https://code.google.com/p/googleappengine/issues/detail?id=11236