libaudioflinger: add stock resampler in pcm offload path

- when samplerate changes in b\w playback, resampler should be plugged-in
  so that the o\p sample rate remains the same to h\w
- this resampler is only enabled on 16 bit PCM path, when channel count is
  <= 2 and channel count doesn't change mid-stream
- once the sample rate resets to original\initial sample rate, resampling
  should not be done
- by default this feature is disabled

Change-Id: Ic27bbf9174d0a83297ebc4418eebdc8850272a6b
frameworks/av: Add output close in AudioTrack destructor for offload case

Close audio output handle inside AudioTrack destructor for
offload case to make output handle close/open independent of
each other and support multiple concurrent offload plyabck
session.
This is controlled runtime based on system property:
audio.offload.multiple.enabled

Change-Id: I98b3a6fe03bfddca2ed01a2adc5a33e4ad540e67
stagefright: Handle offload fallback for 24-bit tracks

 * We need to carefully handle fallback in the 24-bit lossless
   sources for outputs such as A2DP, which cannot use PCM
   offload.
 * Clean up the code while in here as well.

Change-Id: I398d964a3c5b18f58fcc79376bc29222e796badc