Some more cleanup of the antivirus code

@karlitschek @PVince81 Please have a look, part of the second commit is OC6 only.