Fix various small problems with configure.

- Fix temporary files not being deleted after use (requested by @attilamolnar).
- Fix the option for disabling rpath.