More file name and mode checks for $fopen{a,r,w}?.
More file name and mode checks for $fopen{a,r,w}?.

This patch adds checks that $fopen is only called with a valid
mode argument. It also checks that the file name for $fopen{a,r,w}?
is a valid looking file name (all characters satisfy isprint()).
The later should prevent creating weird file names because of
Verilog bugs.

themperek/iverilog,themperek/iverilog,themperek/iverilog,CastMi/iverilog,CastMi/iverilog,CastMi/iverilog