Explicitly cast time(NULL) to int.

* Avoids warning about lost precision.
Fix Windows-specific warning about fopen security.