In most jurisdictions, the copyright is yours as soon as it's written. In addition, recording it to a drive of some sort makes it a physical artefact. The law varies from place to place, and in some countries you are expected to register it - but copyright issues like you are talking about are theft. So there is an element of protection if you could prove to Judge Jury the ownership path.
Of course the practicalities are that the unknown person you are paying little money to could indeed be a crook, but most mastering people don't steal music. If you want an element of protection, then just proving it existed at a certain date is usually sufficient. In the US, actual copyright and all it entails is done by registering the music, but if you just wish to be able to fight theft in court, then the old sending it to yourself by a tracked and recorded service, and then not opening the envelope is evidence of existence you could use in court, and very simple. In the UK, we dont need to register copyright, it comes into being as soon as it's created. The US is a little different, but very similar. You don't have to register it, as like the UK, copyright automatically exists - but your registration system makes it a bit simpler in a dispute.
If you are really worried, go to a well known mastering studio. To be honest, sending your music to a total stranger is more likely to just come back sounding horrible, than you get ripped off. Most people make very little from their music, and the megastar big bucks are pretty unlikely as your music is unlikely to suddenly get millions of streams or downloads, so I suspect the likelihood of dodgy dealing is low, but the basic protection is pretty simple.