Haiti declares state of emergency as thousands of inmates escape main prison