Fix audit test module initialization

Check if the fopen result is NULL, not whether it's less than zero.

(cherry picked from commit 5036f91e7b61a73a1ec2d39ce1cc6bbf60dd82ab)

ticket: 7713
version_fixed: 1.12
status: resolved