You were almost right; just use /close -m rather than -c for query windows.