US stocks close Friday higher, but post weekly losses