Make tablesync worker exit when apply dies while it was waiting for it
Make tablesync worker exit when apply dies while it was waiting for it

This avoids "orphaned" sync workers.

This was caused by a thinko in wait_for_sync_status_change.

Author: Petr Jelinek <b367df07764ed8933171fa23a4ba0635ea1c3c0f@2ndquadrant.com>
Reported-by: Masahiko Sawada <0d3f32509050f7c81bb678704ce670a00c85cc96@gmail.com>

lisakowen/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,adam8157/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,greenplum-db/gpdb