Avoid core dump if rpc port is in use.