main: fix hot restart regression in 2.4
main: fix hot restart regression in 2.4

In 26043b48, some changes were made to allow specifying a different
control API port.

However, this broke the SIGUSR2 hot restart in two ways. First, it added
a second goAgainErr, overwriting the one that we need to use to detect
that the fork happened. This meant that, when the child was forked, the
parent would never exit properly.

Second, it made it impossible for generateListener to use a port 0,
meaning to use a random port. This would result in both parent and child
trying to use the same port before the parent is killed, meaning that
the child would not be able to start up properly.

After these fixes, a hot restart with the default tyk.conf works again.
Writing a Go test for hot restarts is impossible though, so we will
write them separately as python end-to-end tests, covering all
possibilities of listen options combined with SIGUSR2.

Note that we will need further fixes to the goagain library once we
switch to Go 1.9, as it uses reflection and the struct it peeks at
changed in 1.9.

Fixes #1268.

lonelycode/tyk,lonelycode/tyk,lonelycode/tyk