Fix sed inplace substitution.

The -i option is not portable.

http://stackoverflow.com/questions/10811458/how-to-fix-sed-inplace-replacement-mac-os-and-ubuntu-issue