Before this patch we could exit the process without waiting for
file writing task to complete.
As a result a file could become corrupted or a large chunk of data
could be missing.
Now the main thread either waits until file writing task completes
or it writes log buffer to file itself.
1. Added --workdir command-line argument that lets configure the working dir.
2. Made "dnsforward" use this workdir parameter when saving/reading querylog.
3. Reworked "dnsforward" -- moved http handlers out of there to control.go