On stop, set pins to OUTPUT mode before writing

Prior to this commit, there was no guarantee that none of the pins would be in
INPUT mode.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>