The wrong datadir id was being passed in for uploading to when
a duplicate entry was found.
Chagne parameter port from uint to int.
Add MCFS_HOST, MCFS_PORT environment variables, and use them.