E-commerce cosmetics sales have surged over the past five years, providing a big boost to online behemoth Amazon.