Allow port number to be zero to use a random free port.

Keep track of the threads started.
Wait for threads to finish when stopping for a clean shutdown.
Fix compiler warnings.
Fix some issues reported by Coverity static analysis tool.
Copyright 2013 F-Secure Corporation.
Merge pull request #9 from tzimmofsecure/master

Allow port number to be zero to use a random free port.
Update RELEASE_NOTES.md
Updated comments
Fixed Lua compile error with recent change to conn2()
Updated test makefile to eb easier to read.
Updated permissions on test CGI programs
Fixed some errors with the usage of mg_stat()
Fixed mod_lua.inl compile warnings