[ale] sync sinks when application terminates.

Change-Id: I829bde302939412b29522126ff9c745177b37886
Reviewed-on: http://review.couchbase.org/39366
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-11537 use formula backfill_remaining + qlen to calculate tap backlog size

per advise from storage engine team
because total_backlog_size currently includes checkpoint_meta items thus
producing incorrect result

Change-Id: Ifdf522456b82b8e054be2b875b31d79908ef9639
Reviewed-on: http://review.couchbase.org/39247
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>