Add call to wg.Wait() before returning from Serve(), fix test

http.Serve does not wait for requests to finish, so we have to wait
for the GracefulServer's WaitGroup to reach zero, or the process will
exit and in-flight routines will be killed.

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Ensures the FinishRoutine is only called once per instance

This fixes a crash where the HTTP server might close the client
connection during a transfer (via the chunkWriter for example) and might
call Close() again after completion, resulting in a crash:
    sync: negative WaitGroup counter
fix a cacography
Merge pull request #12 from Daizong/patch-1

fix a cacography
Merge pull request #10 from cotap/wait-before-exit

Add call to wg.Wait() before returning from Serve(), fix server tests
Merge pull request #11 from etix/master

Ensures the FinishRoutine is only called once per instance
Refactor to use the ConnState callbacks introduced in Go 1.3. This will
not compile in Go 1.2.