aio_fsync/2-1.c: fix race at exit, check if write completed

This is same issue as:
  commit 4558bfae923a715ac78b5b3d3ecdfa16f9424808
  Author: Jan Stancek <jstancek@redhat.com>
  Date:   Wed Dec 5 12:49:47 2012 +0100
      aio_read/7-1.c: fix race at exit

This patch waits for aio_fsync to complete and after that
checks that previously queued write is also completed.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>