More explicit panic message on out of memory.
Sentinel: turn old master into a slave when it comes back.
Test: split conceptually unrelated comments in RDB test.
Test: fix RDB test checking file permissions.

When the test is executed using the root account, setting the permission
to 222 does not work as expected, as root can read files with 222
permission.

Now we skip the test if root is detected.

This fixes issue #1034 and the duplicated #1040 issue.

Thanks to Jan-Erik Rediger (@badboy on Github) for finding a way to reproduce the issue.
rio.c: added ability to fdatasync() from time to time while writing.
AOF: sync data on disk every 32MB when rewriting.

This prevents the kernel from putting too much stuff in the output
buffers, doing too heavy I/O all at once. So the goal of this commit is
to split the disk pressure due to the AOF rewrite process into smaller
spikes.

Please see issue #1019 for more information.