FileWrite: fix warnings

Namely:
- unused but set
- will break strict aliasing
- unchecked return value (fread)