Don't try to initialize EmulatorView before a TermSession is attached

This avoids a crash when the view is inflated from XML and a TermSession
isn't attached right away.
EmulatorView library: use default scheme if setColorScheme() not called

The documentation (and common sense) suggests that it shouldn't be
necessary to call setColorScheme() on the EmulatorView and TermSession
before using them, but this currently causes crashes.  Fix this by
introducing a default color scheme (corresponding to white on black,
with the color values as defined in the default BaseTextRenderer color
arrays).
Make setColorScheme(null) set the default color scheme
TermSession: move writes to the OutputStream off the main thread

This has two major advantages:

* Big/slow writes no longer block the main thread, leading to more responsive
  UI (compare the effects of dmesg in a terminal before and after).
* It's now possible to pass a network socket directly to setTermOut() on
  API >= 11.  Previously, this would result in an exception on Honeycomb and
  later because of the network I/O on the main thread.
TermSession: Use more descriptive thread names
TermSession: add processInput() method to allow subclasses to modify input data

It's useful for derived classes to be able to modify the input stream
before passing it on to the TerminalEmulator (e.g. to interpret protocol
commands).  At the moment, this requires that they wrap the real
InputStream with a filtering component; instead, give them a method to
override, which should generally be more convenient.
TermSession: Update appendToEmulator() for consistency with processInput()

* Make appendToEmulator() final.  Technically an API break, but not a
  painful one given the youth of the API and the existence of a direct
  equivalent.
* Change parameter names to be consistent with readFromProcess()
* Clarify the difference between appendToEmulator() and
  readFromProcess()
TermSession: stop the reader/writer threads and close streams in finish()

This prevents the leaking of threads when we go away.  Note that we also
close the attached InputStream and OutputStream, since that's the only
reliable way to interrupt the threads if they're blocking for I/O on
those streams.
TermSession: Improve the overall description of the class

* Document our use of threads
* Point out that EmulatorView will initialize an attached TermSession for you
* Suggest users call finish() when done with the session
TermSession: Add a write() method which functions on byte arrays

This will be more convenient for many use cases than the existing
methods, which operate on Strings and individual Unicode code points.
Also, by modifying the existing methods (which encode their input to
UTF-8 bytes) to use this one for pushing data to the writer thread, we
give subclasses a single method to override if they need to modify the
output stream.
TermSession: fix obvious documentation bugs

* copy-paste bug in the description of write(int codePoint)
* eliminate specific references to tty in processInput()
TerminalEmulator: do all I/O via TermSession

This ensures that subclasses of TermSession see all of the I/O coming
from the terminal emulator.
EmulatorView: Request focus when clicked on
EmulatorView: initialize after attachSession() if needed

onSizeChanged() no longer tries to initialize the view if no TermSession
is attached, so we need to call initialize() in attachSession() in that
case.
EmulatorView: update font size the first time setDensity() is called

This ensures that the default font size is density-independent (font
sizes set via setTextSize() are already density-independent).
Update HTML JavaDoc documentation for library
Term: Have EmulatorViews request focus when clicked

The only time this doesn't make sense is if the click will open the menu
or show the action bar.
TermViewFlipper: Have EmulatorView request focus in resumeCurrentView()

Fixes a bug where input focus would be taken by the action bar under the
following conditions:

* the device has a hardware keyboard and navigation keys, D-pad, or
  trackball;
* the action bar is showing;
* more than one window is open;
* and the current window is closed by someone typing "exit" on the
  hardware keyboard.

After the previous commit, it's now possible to give the EmulatorView
focus just by tapping on it, but it's better to fix this at the source.