app_server: The client memory allocator is now reference counted.

* Not sure if cursors could also have triggered this, but with the
  Desktop bitmaps, the memory allocator needs to stay alive as long as
  the bitmap is alive.
* This fixes an immediate crash after setbackground returns.
* However, this may also reveal cases of memory that is not freed
  correctly.