Fix bug in smbclients 'put' command tridge found a while ago. Add tests