This fixes a subtle and nasty bug in my 86664638. The problem is that free(nullptr) is well defined (and common).
The specification for the nofree attributes talks about memory objects, and doesn't explicitly address null, but I think it's reasonable to assume that nofree doesn't disallow a call to free(nullptr). If it did, we'd have to prove nonnull on an argument to ever infer nofree which doesn't seem to be the intent.
This was found by Nuno and Alive2 over in https://reviews.llvm.org/D100141#2697374. Once I saw the test case (and explanation Nuno provided), I also suspect this is the root cause of https://github.com/emscripten-core/emscripten/issues/9443 as well. (Though that had at least two root issues, so there might be more as well.)