ao_pulse: fix potential compilation problem

It seems at least on some platforms (OSX 10.9), the POSIX wait()
function becomes visible, and conflicts with this unrelated function.
Just rename it.
player: fix idle mode event handling
ass: remove some pointless ifdeffery

This will print compiler warnings about unused variables with older
libass versions, but that's harmless.
video: fix corner case with accidental EOF

The video flushing logic was broken: if there are no more packets,
decode_image() will feed flush packets to the decoder. Even if an image
was produced, it will return the demuxer EOF state, and since commit
7083f88c, this EOF state is returned to the caller, which is incorrect.

Revert this part of the change, and explicitly check for VD_WAIT (the
bogus change was intended to forward this error code to the caller).

Also, turn the "r < 1" into something equivalent that doesn't rely on
the exact value of VD_EOF. "r < 0" is ok, because at least here, errors
are always negative.