US stocks close with losses on corporate earnings, geopolitics