Fix bashisms in heartbeat/* scripts