Synchronize calls to Matcher.closeImpl.

Bug: 7603088
Change-Id: I4ed42342438e4e74eecd2e4013be0c85e9b2ef29