imfile: some state flags where not properly preserved for readmode != 0

see also https://github.com/rsyslog/rsyslog/issues/144
Merge branch 'master-imfile-readmode' of https://github.com/rsyslog/rsyslog into master-imfile-readmode