[renderd] bug fixes that could lead to segmentation faults on tile write



git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@29410 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4