hostapdpatcher: close first fopen in seccond fopen fail