Wrong attachment URL with relative URLs

Fixes #3657.

Note:

 * I'm not a ruby expert at all. So the fix may not be perfect. But it works for me.
 * It's still missing a fix for image previews in notes. This must probably be done by overriding some setting for `CarrierWave::Uploader::Base` in the `AttachmentUploader`. Any help on this is much apreciated.