Fix JSON for multiline messages

A couple tweaks after putting #6 into use. Sometimes the drone gets more than one line of output on stdout or stderr. These two fixes should ensure that it still logs valid json when this happens.