Add --enable-valgrind configure option

Valgrind requires shared objects to be kept open for meaningful
debug information. Add configure option to disable dlclose() in
dylib_close().