Fix various small problems with configure.

- Fix temporary files not being deleted after use.
- Fix the option for disabling rpath.