This could be resolved with a multi sig wallet I would think. Hopefully someone with more technical knowledge of multi sig wallets can chime in on this. My rule of thumb is that if something requires you to trust someone with your currency don't do it.
A few people have attempted to address your question, however have not done so to my satisfaction.
First of all true multisig would be somewhat difficult to implement because it would make it very difficult for many people to use because many people have the knowledge of bitcoin of a new; it would make it more difficult to obscure/tumble bitcoin while customers had their funds on 'deposit' at the sites (I know that SR1 did this for their customers, and would assume that other dark markets offered similar services); and probably most importantly it would make it a lot more difficult to collect whatever fee the market is charging for listing/selling products.
In addition to the above, it would probably create a number of instances where a lot of deals would end up taking place outside of the marketplace which would open the door for scams.
In order to describe how multisig works, you first need to know how a bitcoin address is calculated. In order to calculate a bitcoin address, you first need the private key, from the private key, you can easily calculate the public key, from the public key you can calculate the bitcoin address.
In order to calculate a multisig address, you will need to combine multiple public keys, as well as determine what "m" and "n" are when expressed as 'm of n', you would do this by having each party circulate a public key to a private key that they control. Once this is done, assuming that everything went smoothly, then the buyer and the seller can sign a tx giving all of the funds to the seller