ftp: formatting and typos fixes
ftp: rename function name

ftp_send_command was used only once.

This commit makes this function specific, not generic
ftp: credentials moved into FTPContext

FTP server may disconnect client.

This commit stores credentials for future reconnect.
ftp: move create control connection to function

Move common code that opens control connection to function.
This code can be reused when reconnecting to FTP server
after inactivity.
ftp: reconnect on read

FTP server may disconnect after some period of time when no transfer is done.

FTP protocol should reconnect and seek to last position.
ftp: enhanced status code handling

Reimplementation of ftp_status function.
New version requires explicit list of expected codes.
It flush data connection input before sending a command
and blocks until expected result appears.
ftp: move common commands code to function

Each send command routine requires the same steps.
This commit moves repeated code into one function.
ftp: reconnect on seek

ABOR command usually takes long (FTP server implementation dependent).
It also produces different response codes from different servers.

It is save for ffmpeg to reconnect both connection during seek for two reasons:
1. Alreay mentioned heavy manner of ABOR command.
2. Server may disconnected due to no transfer (seek after a long pause in ffmpeg client)
ftp: enhanced error handling

Add error codes to expected codes to make responses faster.
Success of a command is validated by comparing code to a success code.
Merge remote-tracking branch 'lukaszmluki/master'

* lukaszmluki/master:
  ftp: enhanced error handling
  ftp: reconnect on seek
  ftp: move common commands code to function
  ftp: enhanced status code handling
  ftp: reconnect on read
  ftp: move create control connection to function
  ftp: credentials moved into FTPContext
  ftp: rename function name
  ftp: formatting and typos fixes

Merged-by: Michael Niedermayer <michaelni@gmx.at>