Solve ENOTEMPTY bug when testing in Linux systems