Log request allocation failures

Part of the patch listed here :-
https://trac.torproject.org/projects/tor/ticket/2207
Atom length comment and datatype fixes

Taken from the patch listed here :-
https://trac.torproject.org/projects/tor/ticket/2173
Add a couple of failure warnings

Taken from the patch listed here :-
https://trac.torproject.org/projects/tor/ticket/2173