An advertisement for a tiny flat in Shanghai that featured a bed behind a toilet bowl went viral because it highlighted the city’s expensive real estate prices.