Oil prices post a weekly loss on stockpile releases