baseparse: Fix upstream read caching

When running in pull mode (for e.g. mp3 reading),
baseparse currently reads 64KB from upstream, then mp3parse
consumes typically around 417/418 bytes of it. Then
on the next loop, it will read a full fresh 64KB again,
which is a big waste.

Fix the read loop to use the available cache buffer first
before going for more data, until the cache drops to < 1KB.

Fixes #518
18 jobs for 1.16 in 51 minutes and 21 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Preparation
passed #2986503
gst indent

00:00:23

passed #2986502
manifest

00:00:21

 
  Build
passed #2986512
build cerbero android universal

00:10:15

passed #2986513
build cerbero cross win32

00:09:39

passed #2986514
build cerbero cross win64

00:06:15

passed #2986511
build cerbero fedora x86_64

00:04:05

passed #2986516
gst-ios-13.2
build cerbero ios universal

00:45:12

passed #2986515
gst-macos-10.15
build cerbero macos x86_64

00:10:35

passed #2986504
build fedora x86_64

00:04:40

manual #2986510
1809 windows docker allowed to fail manual
build msys2
passed #2986505
build nodebug fedora x86_64

00:02:29

passed #2986506
build static fedora x86_64

00:03:14

passed #2986507
build static nodebug fedora x86_64

00:02:14

passed #2986508
1809 windows docker
build vs2017 amd64

00:19:22

passed #2986509
1809 windows docker
build vs2017 x86

00:19:22

 
  Test
passed #2986517
gstreamer
check fedora

00:02:33

passed #2986518
gstreamer
integration testsuites fedora

00:05:46

 
  Integrate
passed #2986519
android universal examples

00:08:08