Fixing smb master

This PR contains some front-ports of code with has been allied to stable45 in Dec 2012.

In addition anther bug regarding special characters has been fixed (backport to stable45 will follow)
We should double if other implementations (Google, DropBox ....) do proper url encoding like:
https://github.com/owncloud/core/pull/new/fixing-smb-master#L1R48

fixes #130 #374(maybe?) #1361 

@icewind1991 @karlitschek @MTGap @butonic THX