A Coalgebraic Semantics for Imperative Programming Languages