cleanup callback handling logic, add as err listener

errors on app.listen do not invoke the callback passed as a parameter, but emit an 'error' event. So if a callback is provided, add it as an error event listener.