Bangladesh out of danger after thousands affected by cyclone