androidmedia: fix use of invalid buffers

flush after we are out of the decoding loop so that
buffers are invalidate when no one will access them
android: add support for direct rendering
androidmedia: fix rank for more software decoders

In Galaxy S4 the codecs list contains some OMX.SEC.foo.sw.dec
as software decoders

https://bugzilla.gnome.org/show_bug.cgi?id=711214