configure: wrap some library tests with GIT_STASH_FLAGS