Fix test/run_tests.sh to run on OSX

I started reading this project's source code. 
First of all, I ran `test/run_tests.sh` but this script can't be run on OSX because:

- `realpath` doesn't exist
- OSX's `mktemp` doesn't generate tempfile without argument

Because I'm not familiar with Linux, this change is helpful for me.
Maybe this script will work well on both platforms.

Sorry for nit pick.