remote_bitbang: De-duplicate init code and clean up on error