AOF: fix a bug that may prevent proper fsyncing when fsync=always.
AOF: fix a bug that may prevent proper fsyncing when fsync=always.

In case the write handler is already installed, it could happen that we
serve the reply of a query in the same event loop cycle we received it,
preventing beforeSleep() from guaranteeing that we do the AOF fsync
before sending the reply to the client.

The AE_BARRIER mechanism, introduced in a previous commit, prevents this
problem. This commit makes actual use of this new feature to fix the
bug.

GitHubMota/redis,ofirluzon/redis,charsyam/redis,yossigo/redis,neomantra/redis,pmem/redis,soloestoy/redis,antirez/redis,antirez/redis,pmem/redis,yossigo/redis,PKRoma/redis,oranagra/redis,spinlock/redis,nnog/redis,spinlock/redis,yossigo/redis,pmem/redis,oranagra/redis,GitHubMota/redis,spinlock/redis,neomantra/redis,ofirluzon/redis,soloestoy/redis,charsyam/redis,charsyam/redis,pmem/redis,soveran/redis,oranagra/redis,neomantra/redis,charsyam/redis,ctripcorp/redis,yossigo/redis,ofirluzon/redis,nnog/redis,nnog/redis,antirez/redis,soveran/redis,soloestoy/redis,antirez/redis,ofirluzon/redis,ctripcorp/redis,soveran/redis,GitHubMota/redis,PKRoma/redis,soveran/redis,neomantra/redis,ofirluzon/redis,oranagra/redis,oranagra/redis,spinlock/redis,PKRoma/redis,soloestoy/redis,GitHubMota/redis,soloestoy/redis,ctripcorp/redis,PKRoma/redis,PKRoma/redis,neomantra/redis,ctripcorp/redis,yossigo/redis,charsyam/redis,nnog/redis