[daemons] Sanity check port number arguments before use