A 19-year-old boy has been publicly executed in Libya after he refused four times to repent for swearing.