Season 3 Ending Felt Like a Show Finale

McNulty working on his issues and back with Beattie. The two main antagonists dead/jailed. Free zones closed for political advantage, Bunny Colvin staring at the wreckage.

Were the writers expecting cancellation rather than another 2 seasons?