US stocks close Thursday with losses