Repository: don't jump to cleanup unecessarily

Until we have successfully borrowed the message, we have not used up any
resources, we can skip jumping to 'out' and we can return NULL
directly. This also avoid dereferencing an uninitialised 'tmessage'.
Merge remote-tracking branch 'carlos/uninitialsed'