build: don't ignore last line in Dockerfile when it doesn't end with \n

Fix #873.