US stock market opens lower, heading for weekly losses