Reuse ssl_write() function for select and logout commands.

Signed-off-by: Thiago Farina <tfarina@chromium.org>