* src/nsterm.h: Update EmacsSurface definition.
* src/nsterm.m ([EmacsView focusOnDrawingBuffer]): Don't change the
CGContext's settings directly.
([EmacsView unfocusDrawingBuffer]): Don't release the context here.
(CACHE_MAX_SIZE): Add maximum cache size.
([EmacsView updateLayer]): Send a request for getContext, which will
copy the buffer and create the context if it doesn't already exist, to
the NS run loop.
([EmacsSurface initWithSize:ColorSpace:Scale:]): Add the scale factor
and if there's already a CGContext available, reuse it.
([EmacsSurface dealloc]): No longer need to release lastSurface
separately.
([EmacsSurface getContext]): Don't create more surfaces than we have
spaces for in the cache.
([EmacsSurface releaseContext]): If there's no context don't try to
release it and put currentSurface back on the cache instead of
lastSurface.
([EmacsSurface copyContentsTo:]): Don't try to copy if the source and
destination are actually the same surface.