egl: fbdev: Use refcounting to manage window and buffer lifetime

As per the promises made in ANativeWindow interface, we can't assume that
we hold the only references to the buffers. Although not mentioned out loud,
in practice this seems to be true for windows as well.

Supporting multiple windows seems nontrivial due to limited buffer space
in the framebuffer so currently we will quite likely fail to allocate buffers
for a second window. In some cases even when the previous window has been
released by us (but not by eg. EGL drivers).

Signed-off-by: Kalle Vahlman <kalle.vahlman@movial.com>
elg: fbdev: Fix cancelBuffer() behaviour, clean up dead code

We should make the cancelled buffer available for use again and update
our bookkeeping in cancelBuffer().

Signed-off-by: Kalle Vahlman <kalle.vahlman@movial.com>
Merge pull request #146 from kvahlman/fbdev-lifetime

Fbdev buffer management fixes