add a simple implementation of TLS

this adds a simple implementation of TLS
it only works in the current thread
it can't be generalized, I think, without a glibc and/or libthread_db
extension, in particular to find the "module id" (which we can't
readily get) from the "link map address" (which we can).
If we had that then we could, for instance, emit a call to
__tls_get_addr
add some TLS warnings for the user
implement deferred error handling

if we can't handle a particular local symbol, we defer any error
messages arising from it until the symbol is actually referenced.
I think this should yield friendlier behavior for users.
add ui_file_write_for_put and update

This adds the convenience function ui_file_write_for_put
and updates one existing spot to use it.
It also arranges to avoid partially-formatted code from
being inserted into the C program we're generating,
by allocating a temporary ui-file.