Implemented log buffering.

Added appengine.flushLogs API.
I tried doing that early on, but the problem is that while flushing the application can add new log entries, which in turn may cause a new flush. The Java runtime "solves" this by blocking.