examples: Good error message if script isn't run as a CLI app.

Some people were trying to use these examples as server-side PHP
pages, which doesn't work, and yields a hard-to-understand error
message.