SDL: switch deletion of renderer and buffer.

The renderer might still use the buffer, so delete the renderer first and than the buffer.

Based on a hint from Chase-san