A merchant can lessen the risk of being defrauded in a race attack (on 0/unconfirmed) by:
- Using an explicit list of peers to connect to (with most of the known IP addresses of miners)
- Not allowing incoming connections (turn off uPnP)
this still leaves the merchant vulnerable to a 51% attack that all transactions below 6 confirmations are subject to but also to the Finney attack and another type of attack even where 2 confirmations is required (as described by vector76 here: https://bitcointalk.org/index.php?topic=36788.msg463391#msg463391 )
What you are asking for is a solution that would be useful for merchants who can absorb some risk that comes with accepting a bitcoin transaction at 0/unconfirmed. Currently there is only a trivial number of merchants that accept bitcoin at a retail establishment. And thus, no solution provider -- yet.
There is an API to the service http://transactionradar.com which might make it possible to monitor for double spend attempts.
Some useful conversations related to this topic: