Fix loading of templates with relative names on Windows.

jinja2.exceptions.TemplateNotFound: relative.template; searchpath=['package:\\']

On Windows searchpath gets computed as absolute path causing lookup in the root
of the current drive instead.
Close temporary file properly, otherwise it can't be unlinked on Windows.
Merge pull request #94 from zart/fix-relative-search-on-windows

Fix loading of templates with relative names on Windows.