First fixes for a 64bit compatible ftp extension

The ftp extension is old and does not support 64 bit. Pull request to start discussion and first fixes (testsuite works, my usecase works as well)