Creating curves in Python
The solution was simple enough. I changed

polyline.points.add(len(coords))


to

polyline.points.add(len(coords)-1)


as found here:

http://blenderscripting.blogspot.de/2011/05/blender-25-python-bezier-from-list-of.html