Fix memory leak in compactor.cc

opendir needs a corresponding closedir

Change-Id: I5b101d4cd1f04e84365b5e08d1eee04bd8b91fe5