internal: make log calls panic with a useful error message

Prior to this change, a program would panic with no useful message:
panic: runtime error: invalid memory address or nil pointer dereference

Use the same "not an App Engine context" message that is returned as an
error from other API calls. The log package is special because the
logs are flushed asynchronously, and thus the API call happens later.

Change-Id: I896d8463d2a0d5da7a4fc94fd0dab7b6fcfa8ad7
diff --git a/internal/api.go b/internal/api.go
index 09562c4..aba0f83 100644
--- a/internal/api.go
+++ b/internal/api.go
@@ -576,6 +576,9 @@
 }
 
 func logf(c *context, level int64, format string, args ...interface{}) {
+	if c == nil {
+		panic("not an App Engine context")
+	}
 	s := fmt.Sprintf(format, args...)
 	s = strings.TrimRight(s, "\n") // Remove any trailing newline characters.
 	c.addLogLine(&logpb.UserAppLogLine{