Made the Sphinx detection sed script more portable.

Non-GNU seds may not allow } directly after a command.