Reworked startup sequence to respect server.listen() failures and timings

Previously we had the following errors:
- if the port was already in use, the startup silently failed.
- the message saying NodeBB was ready and bound to a socket came before it was really listening on the socket

This changeset fixes #982, as it finally annoyed me enough.