Add ioctl() to logger module

ioctl(LOGGER_FLUSH) will flush the last incomplete page out by filling
it with '\0'
add the call in record_ctrl.c