Blue Apron trims losses, announces Costco pilot