api: Handle NULs and newlines in buffer_*_line.
api: Add tests for when not to handle NULs.
Merge pull request #1341 from splinterofchaos/api-nul

Api: Improve Nul handling