Server crashes if a flush commmand is issued and binlog is closed. - added check to prevent binlog access when binlog file isn't opened.