Fix NoneType Traceback when no -w option set.

Traceback (most recent call last):
  File "./gmailnotify.py", line 241, in <module>
    main()
  File "./gmailnotify.py", line 238, in main
    run(config, boxes)
  File "./gmailnotify.py", line 92, in run
    f.close()
AttributeError: 'NoneType' object has no attribute 'close'

Check if f is None, don't try to close a file you never opened.