ALSA: pcm: Add snd_pcm_stop_xrun() helper

Add a new helper function snd_pcm_stop_xrun() to the standard sequnce
lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the
existing open codes with this helper.

The function checks the PCM running state to prevent setting the wrong
state, too, for more safety.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
firewire-lib: Add sorting in-packets for full duplex streams with sync

In full duplex streams with synchronization, consistency of SYT field in
in-packets is important for out-packets. This commit add sorting in-packets
according to the value of dbc.