Avoid excessive copying in BitmapData.setPixel and elsewhere

Before this change every setPixel call caused the whole bitmap to be
copied. By using smartrefs of BitmapContainers, the actual pixel data
is not copied. One BitmapContainer is shared between all Bitmaps using
the same BitmapData.

The reference counting is moved into a new RefCountable base class.
[BitmapData] Implement copyChannel
[BitmapData] Implement lock() and unlock()