If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF. Add tests for this scenario.