AudioInput: check iTarget and iPrevTarget for errors before use in flushCheck().
AudioInput: check iTarget and iPrevTarget for errors before use in flushCheck().

@tatokis reported a voice recorder crash on IRC.
(Also filed as mumble-voip/mumble#2863)

The main culprit was missing error checking in flushCheck() for the values
of iTarget and iPrevTarget.

The problem is that iPrevTarget can be set to -1 in error situations,
when using voice target shortcuts. (Whispers and shouts.)

When that happens, the message type output by flushCheck() will be set
to an invalid value (7), because iPrevTarget is -1.

In flushCheck(), when the packet is a terminator, we set the packet's flags
to the value of iPrevTarget. However, in some error states, iPrevTarget is -1.
When flags is set to -1, all bits are high (say, 0xffffffff on 32-bit
systems). Since all bits are high, our attempt to set the message type in
the flags byte fail, because we attempt to splice it in there via binary
OR.

The result is a packet with an invalid message type of 7 gets into our
audio subsystem and wreaks havoc. Due to mistakes in other code in
AudioOutputSpeech, that invalid value could cause a crash. (The problem
was that we expected that all packets that weren't Opus or CELT to be
Speex. Even 'unknown' message types. This will be fixed in a separate
commit.)

Fixes mumble-voip/mumble#2863

Lartza/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble