Lewis Hamilton has posted on social media to reiterate has apology to Ferrari after a "painful lesson" at the Singapore Grand Prix.