blockreplace - ensure newline before appending

append makes sure there is a newline before appending the data

blockreplace might be appending data, but if the file does not end with a newline, the marker_start would follow the line, and not be found in next call.